saasufy-components 9.0.2 → 9.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/oauth-handler.js +6 -2
- package/package.json +1 -1
package/oauth-handler.js
CHANGED
|
@@ -46,7 +46,7 @@ class OAuthHandler extends SocketConsumer {
|
|
|
46
46
|
let relevantStates = expectedOAuthState
|
|
47
47
|
.split(',')
|
|
48
48
|
.filter(expectedState => expectedState && expectedState.split('-')[0] === provider);
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
// Do not process. The state may have been set for a different provider
|
|
51
51
|
// which is handled on the same page.
|
|
52
52
|
if (!relevantStates.length) return;
|
|
@@ -58,10 +58,14 @@ class OAuthHandler extends SocketConsumer {
|
|
|
58
58
|
|
|
59
59
|
let authTimeout = Number(this.getAttribute('auth-timeout') || DEFAULT_AUTH_TIMEOUT);
|
|
60
60
|
let urlSearchParams = new URLSearchParams(location.search);
|
|
61
|
+
let state = urlSearchParams.get(stateParamName);
|
|
62
|
+
|
|
63
|
+
let stateProvider = (state || '').split('-')[0];
|
|
64
|
+
if (stateProvider !== provider) return;
|
|
65
|
+
|
|
61
66
|
let code = urlSearchParams.get(codeParamName);
|
|
62
67
|
|
|
63
68
|
if (code) {
|
|
64
|
-
let state = urlSearchParams.get(stateParamName);
|
|
65
69
|
let socket = this.getSocket();
|
|
66
70
|
|
|
67
71
|
history.replaceState({}, document.title, location.pathname);
|