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

[3.7] Allow serial login flows to co-exist #286

Merged
merged 1 commit into from Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion dist/origin-web-common-services.js
Expand Up @@ -3481,7 +3481,14 @@ angular.module('openshiftCommonServices')
var makeState = function(then) {
var nonce = String(new Date().getTime()) + "-" + getRandomInts(8).join("");
try {
window.localStorage[nonceKey] = nonce;
if (window.localStorage[nonceKey] && window.localStorage[nonceKey].length > 10) {
// Reuse an existing nonce if we have one, so that when multiple tabs get kicked to a login screen,
// any of them can succeed, not just the last login flow that was started. The nonce gets cleared when the login flow completes.
nonce = window.localStorage[nonceKey];
} else {
// Otherwise store the new nonce for comparison in parseState()
window.localStorage[nonceKey] = nonce;
}
} catch(e) {
authLogger.log("RedirectLoginService.makeState, localStorage error: ", e);
}
Expand Down
9 changes: 8 additions & 1 deletion dist/origin-web-common.js
Expand Up @@ -5505,7 +5505,14 @@ angular.module('openshiftCommonServices')
var makeState = function(then) {
var nonce = String(new Date().getTime()) + "-" + getRandomInts(8).join("");
try {
window.localStorage[nonceKey] = nonce;
if (window.localStorage[nonceKey] && window.localStorage[nonceKey].length > 10) {
// Reuse an existing nonce if we have one, so that when multiple tabs get kicked to a login screen,
// any of them can succeed, not just the last login flow that was started. The nonce gets cleared when the login flow completes.
nonce = window.localStorage[nonceKey];
} else {
// Otherwise store the new nonce for comparison in parseState()
window.localStorage[nonceKey] = nonce;
}
} catch(e) {
authLogger.log("RedirectLoginService.makeState, localStorage error: ", e);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/origin-web-common.min.js
Expand Up @@ -2433,7 +2433,7 @@ return randomValues;
}, nonceKey = "RedirectLoginService.nonce", makeState = function(then) {
var nonce = String(new Date().getTime()) + "-" + getRandomInts(8).join("");
try {
window.localStorage[nonceKey] = nonce;
window.localStorage[nonceKey] && window.localStorage[nonceKey].length > 10 ? nonce = window.localStorage[nonceKey] :window.localStorage[nonceKey] = nonce;
} catch (e) {
authLogger.log("RedirectLoginService.makeState, localStorage error: ", e);
}
Expand Down
9 changes: 8 additions & 1 deletion src/services/redirectLoginService.js
Expand Up @@ -74,7 +74,14 @@ angular.module('openshiftCommonServices')
var makeState = function(then) {
var nonce = String(new Date().getTime()) + "-" + getRandomInts(8).join("");
try {
window.localStorage[nonceKey] = nonce;
if (window.localStorage[nonceKey] && window.localStorage[nonceKey].length > 10) {
// Reuse an existing nonce if we have one, so that when multiple tabs get kicked to a login screen,
// any of them can succeed, not just the last login flow that was started. The nonce gets cleared when the login flow completes.
nonce = window.localStorage[nonceKey];
} else {
// Otherwise store the new nonce for comparison in parseState()
window.localStorage[nonceKey] = nonce;
}
} catch(e) {
authLogger.log("RedirectLoginService.makeState, localStorage error: ", e);
}
Expand Down