Giter Site home page Giter Site logo

adityanaag3 / lwc-oss-oauth Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 9.0 4.38 MB

Sample Code for connecting to Salesforce using OAuth Web Server flow from an LWC OSS App

License: Creative Commons Zero v1.0 Universal

JavaScript 76.55% HTML 11.54% CSS 11.91%
lwc-oss salesforce

lwc-oss-oauth's People

Contributors

adityanaag3 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lwc-oss-oauth's Issues

Logout is not really killing the session.

How logout works with Workbench:

  • I go to workbench and select "Production"
  • Workbench redirects me to login screen and I enter credentials for my developer edition org and then taken back to Workbench.
  • I do the logout from Workbench.
  • In new tab, enter the url for the org(I logged in step 2) and it requires you to login (because workbench logout killed the session)

How logout working in this app:

  • Go to localhost:3001 and click Login
  • Redirected me to login screen and I enter credentials for my developer edition org and then taken back to localhost:3001.
  • I click the logout button and it immediately shows login button(I can see from the code, we are doing revokeToken and it is not erroring)
  • In new tab, enter the url for the org(I logged in step 2) and it doesn't require login (logout actually didn't kill the session)

I don't see any console errors when the below code is running:

this.oauth2.revokeToken(session.sfdcAccessToken, (error) => {
    if (error) {
        this.logger.error(
            'Failed to revoke authentication token',
            error
        );
        res.status(500).json(error);
    }
});

I replaced the above code with the below and it still didn't fix the problem:

const conn = new jsforce.Connection({
  sessionId : session.sfdcAccessToken,
  serverUrl : session.sfdcInstanceUrl
});        
conn.logout((err) => {
  if(err){
    this.logger.error('there was error when logging out');
    this.logger.error(err);
  }
});

I tried looking into see how workbench is doing the logout but looks like it is doing soap logout(I could be wrong).

I want to use your app as boilerplate code for something I want to build hence opening this issue.

Thanks for creating this app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.