okta-react icon indicating copy to clipboard operation
okta-react copied to clipboard

Unstable sign out

Open kostia1st opened this issue 5 years ago • 5 comments

Hi,

We have an issue in the up to date version of @okta libs (4.1.0 for @okta/okta-react and 4.6.1 for @okta/okta-auth-js). We use OKTA-hosted login page.

Repro steps:

  • open several tabs of the same SPA with a logged in user;
  • click Sign out in one of the tabs;
  • under the hood we call void oktaAuth.signOut(); and that's it;

Actual result:

  • you get redirected to the OKTA-hosted log in screen, but other tabs just reload (there's some action visible) but when you switch to them - you are still logged in, and you can use the creds stored (they are still in place in localStorage, things like okta-token-storage and others) and navigate the application; OR
  • you get redirected to the OKTA-hosted log in screen in the current and all other open tabs as well; (expected result)

The two above scenarios happen unstably one or another, like 50/50.

It seems like there's some kind of a race condition, or maybe some dependency on the random order of events emitted internally by OKTA on localStorage update.

kostia1st avatar Jan 21 '21 19:01 kostia1st

@estorski Thanks for reporting the issue! I'll investigate on the issue, meanwhile, can I know the browser and the version that you can repro the issue?

Internal Ref: OKTA-364608

shuowu avatar Jan 26 '21 18:01 shuowu

Hey @shuowu

The browser is Chrome Version 87.0.4280.141 (Official Build) (64-bit)

kostia1st avatar Jan 27 '21 20:01 kostia1st

@estorski I am not able to reproduce the issue with our react sample app. Please feel free to reach out to our support staff at [email protected] to collect reproduction details.

shuowu avatar Mar 08 '21 20:03 shuowu

Hello, @shuowu @estorski I have the same issue. libs (5.1.1 for @okta/okta-react and 4.9.0 for @okta/okta-auth-js). Maybe we could create a shared codesandbox and try to reproduce it.

LongJohnSilver1504 avatar May 21 '21 15:05 LongJohnSilver1504

Relates to #148

Try workaround: https://github.com/okta/okta-react/issues/148#issuecomment-951019063

shuowu avatar Oct 25 '21 15:10 shuowu