Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout not clearing SessionStorage for msal.interaction.status #9

Open
Jeff-Stapleton opened this issue Nov 3, 2022 · 2 comments
Open

Comments

@Jeff-Stapleton
Copy link

When attempting to sign out using the below method

  const logout = async (): Promise<void> => {
    await MsAuthPlugin.logout({
      clientId: props.config.clientId,
      tenant: props.config.tenantId,
      authorityType: 'AAD',
      authorityUrl:
        'https://login.microsoftonline.com/00000000-0000-0000-0000-0000000000,
      knownAuthorities: [
        'https://login.microsoftonline.com/00000000-0000-0000-0000-0000000000
      ]
    });
  };

It appears to work but if I try to immediately turn around and sign in again It will throw the following error

web.js:10 MSAL: Error occurred while logging in BrowserAuthError: interaction_in_progress: Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API.  For more visit: aka.ms/msaljs/browser-errors.
    at BrowserAuthError.AuthError [as constructor] (AuthError.js:31:1)
    at new BrowserAuthError (BrowserAuthError.js:197:1)
    at BrowserAuthError.createInteractionInProgressError (BrowserAuthError.js:264:1)
    at BrowserCacheManager.setInteractionInProgress (BrowserCacheManager.js:886:23)
    at ClientApplication.preflightInteractiveRequest (ClientApplication.js:777:1)
    at ClientApplication.preflightBrowserEnvironmentCheck (ClientApplication.js:762:1)
    at ClientApplication.acquireTokenPopup (ClientApplication.js:277:1)
    at MsAuth.acquireTokenInteractively (web.js:42:40)
    at web.js:7:1
    at async MsAuth.login (web.js:7:1)

After digging around I noticed that the session storage wasn't being cleared

Screen Shot 2022-11-03 at 4 24 57 PM

If I manually clear this -- the login will succeed

@bartwesselink
Copy link
Member

Hello @Jeff-Stapleton, could you try it with the latest release (v3.1.2)? Does the issue still occur?

In this version, the logout method was updated and the Azure MSAL version was bumped.

@Jeff-Stapleton
Copy link
Author

Thanks for following up on this. I will upgrade the package and test it out today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants