From b0d9ec0502db7709f316ee634c22958bb66f22c5 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Wed, 19 Feb 2020 14:53:03 -0700 Subject: [PATCH] Bug Fix: Add timeout to prevent OIDC modal login bug (#8385) * set timeout to give time for data to be written to local storage preventing oidc login bug * remove clear as this might be the only way for folks to login to safari right now, bug there --- ui/app/components/auth-jwt.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/app/components/auth-jwt.js b/ui/app/components/auth-jwt.js index f349c5cf4..8c3bc69d4 100644 --- a/ui/app/components/auth-jwt.js +++ b/ui/app/components/auth-jwt.js @@ -109,7 +109,11 @@ export default Component.extend({ }, exchangeOIDC: task(function*(event, oidcWindow) { - let oidcState = event.storageArea.getItem('oidcState'); + // in non-incognito mode we need to use a timeout because it takes time before oidcState is written to local storage. + let oidcState = Ember.testing + ? event.storageArea.getItem('oidcState') + : yield timeout(1000).then(() => event.storageArea.getItem('oidcState')); + if (oidcState === null || oidcState === undefined) { return; }