From 27f7b25677cd4b4218b1f17975d1929a937a8026 Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Mon, 13 Nov 2017 14:55:01 -0700 Subject: [PATCH] fixed for logged in users --- js/app.js | 17 +++++++++-------- js/controllers/login-controller.js | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/js/app.js b/js/app.js index 12324ed..53a1d87 100644 --- a/js/app.js +++ b/js/app.js @@ -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); } }); }]); diff --git a/js/controllers/login-controller.js b/js/controllers/login-controller.js index b050f70..7111b30 100644 --- a/js/controllers/login-controller.js +++ b/js/controllers/login-controller.js @@ -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({