Skip to content
Snippets Groups Projects
Commit b56cf8e8 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Merge pull request #1955 from mozilla/issue_1937

special case auth_with_primary so that we have context and we redirect appropriately
parents 7249f852 cbf2e7d9
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,13 @@
var wc = WinChan.onOpen(function(origin, args, cb) {
if (window.location.hash === '#complete') cb();
else {
var fullURL = args;
// store information in window.name to indicate that
// we redirect here
window.name = 'auth_with_primary';
wc.detach();
window.location = args;
window.location = fullURL;
}
});
......@@ -33,11 +33,17 @@
};
navigator.id.completeAuthentication = function(cb) {
window.location = 'https://login.persona.org/sign_in#AUTH_RETURN';
if (window.name == 'auth_with_primary')
window.location = 'https://login.persona.org/authenticate_with_primary#complete';
else
window.location = 'https://login.persona.org/sign_in#AUTH_RETURN';
};
navigator.id.raiseAuthenticationFailure = function(reason) {
window.location = 'https://login.persona.org/sign_in#AUTH_RETURN_CANCEL';
if (window.name == 'auth_with_primary')
window.location = 'https://login.persona.org/authenticate_with_primary#complete';
else
window.location = 'https://login.persona.org/sign_in#AUTH_RETURN_CANCEL';
};
navigator.id._primaryAPIIsShimmed = true;
......
......@@ -136,17 +136,12 @@ BrowserID.PageHelpers = (function() {
throw "cannot verify with primary without an email address and URL"
}
var url = helpers.toURL(baseURL, {
email: email,
return_to: "https://login.persona.org/authenticate_with_primary#complete"
});
winchan.open({
url: "https://login.persona.org/authenticate_with_primary",
// This is the relay that will be used when the IdP redirects to sign_in_complete
relay_url: "https://login.persona.org/relay",
window_features: "width=700,height=375",
params: url
params: helpers.toURL(baseURL, {email: email})
}, function(error, result) {
// We have to force a reset of the primary caches because the user's
// authentication status may be incorrect.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment