fixed for logged in users

This commit is contained in:
Jon Lambson 2017-11-13 14:55:01 -07:00
parent a3cb728afd
commit 27f7b25677
2 changed files with 10 additions and 8 deletions

View File

@ -156,14 +156,14 @@ app.config([
app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $state, Auth, $location) {
$rootScope.urlCrumbs = [];
debugger;
var Crumbs = new Object();
var param;
console.log('the path', decodeURIComponent($location.$$absUrl));
Crumbs = {
absUrl: decodeURIComponent($location.$$absUrl),
url: decodeURIComponent($location.$$url),
path: decodeURIComponent($location.$$path),
params: decodeURIComponent($location.$$search),
path: $location.$$path,
params: $location.$$search,
};
if (Crumbs.url.includes('%')) {
param = $location.$$path;
@ -175,17 +175,18 @@ app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $stat
Crumbs = {
absUrl: decodeURIComponent($location.$$absUrl),
url: decodeURIComponent($location.$$url),
path: decodeURIComponent($location.$$path),
params: decodeURIComponent($location.$$search),
toPath: decodeURIComponent(toState.url),
fromPath: decodeURIComponent(fromState.url)
path: $location.$$path,
params: $location.$$search,
toPath: toState.url,
fromPath: fromState.url
};
$rootScope.urlCrumbs.push(Crumbs);
console.log($rootScope.urlCrumbs);
if (requiresLogin && !Auth.isLoggedIn()) {
event.preventDefault();
$state.go('splash-page', { 'toState': toState.name });
} else {
window.location.replace($rootScope.urlCrumbs[0].absUrl);
}
});
}]);

View File

@ -126,6 +126,7 @@ app.controller('loginCtrl', [
};
vm.auth = function () {
console.log('this ran');
var subject = vm.currentSubject;
var issuer = vm.issuerName;
return vm.newOauth3.authenticate({