Skip to content

Commit

Permalink
Clear the URL params and hash after logging out.
Browse files Browse the repository at this point in the history
  • Loading branch information
glsee committed Feb 12, 2015
1 parent a133765 commit 7d118ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
11 changes: 6 additions & 5 deletions examples/client/vendor/satellizer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Satellizer 0.9.1
* Satellizer 0.9.2
* (c) 2015 Sahat Yalkabov
* License: MIT
*/
Expand Down Expand Up @@ -95,7 +95,7 @@
url: '/auth/live',
authorizationEndpoint: 'https://login.live.com/oauth20_authorize.srf',
redirectUri: window.location.origin || window.location.protocol + '//' + window.location.host,
scope: ['wl.basic', 'wl.emails'],
scope: ['wl.emails'],
scopeDelimiter: ' ',
requiredUrlParams: ['display', 'scope'],
display: 'popup',
Expand Down Expand Up @@ -274,8 +274,9 @@
};

shared.setToken = function(response, isLinking) {
var token = response.access_token || config.tokenRoot && response.data[config.tokenRoot] ?
response.data[config.tokenRoot][config.tokenName] : response.data[config.tokenName];
var token;
token = (response.access_token) || (config.tokenRoot && response.data[config.tokenRoot] ?
response.data[config.tokenRoot][config.tokenName] : response.data[config.tokenName]);
var tokenName = config.tokenPrefix ? config.tokenPrefix + '_' + config.tokenName : config.tokenName;

if (!token) {
Expand Down Expand Up @@ -318,7 +319,7 @@
delete $window.localStorage[tokenName];

if (config.logoutRedirect) {
$location.path(config.logoutRedirect);
$location.url(config.logoutRedirect);
}
return $q.when();
};
Expand Down
2 changes: 1 addition & 1 deletion satellizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
delete $window.localStorage[tokenName];

if (config.logoutRedirect) {
$location.path(config.logoutRedirect);
$location.url(config.logoutRedirect);
}
return $q.when();
};
Expand Down
Loading

0 comments on commit 7d118ab

Please sign in to comment.