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
This commit is contained in:
Angel Garbarino 2020-02-19 14:53:03 -07:00 committed by GitHub
parent 971826a646
commit b0d9ec0502
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}