This commit is contained in:
Jon Lambson 2017-08-29 09:34:58 -06:00
parent 69a6783e44
commit 072af04a4d
1 changed files with 7 additions and 9 deletions

View File

@ -126,17 +126,15 @@ app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $stat
// }
if (requiresLogin && !Auth.isLoggedIn()) {
event.preventDefault();
toState.data.session.token = OAUTH3.jwt.decode(query.access_token);
toState.data.session.refresh = OAUTH3.jwt.decode(query.refresh_token);
if (!angular.equals(toState.data.session, {})) {
// if ('access_token' in urlParams && 'refresh_token' in urlParams && 'issuer' in urlParams && 'audience' in urlParams) {
Auth.add(query);
console.log('go here', $rootScope.redirectedURL);
$state.go('app.'+$rootScope.redirectedURL)
// $location.path($rootScope.redirectedURL);
// }
toState.data.session.token = OAUTH3.jwt.decode(query.access_token);
toState.data.session.refresh = OAUTH3.jwt.decode(query.refresh_token);
Auth.add(query);
console.log('go here', $rootScope.redirectedURL);
$state.go('app.' + $rootScope.redirectedURL);
} else {
$state.go('splash-page', { 'toState': toState.name });
}
// $state.go('splash-page', { 'toState': toState.name });
}
});
}]);