From 9d379c759cd12d605c91065a68118e85d3a2e683 Mon Sep 17 00:00:00 2001 From: Jon Lambson Date: Fri, 25 Aug 2017 16:32:12 -0600 Subject: [PATCH] asadf --- js/app.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/app.js b/js/app.js index e5796f0..96e1dbb 100644 --- a/js/app.js +++ b/js/app.js @@ -126,11 +126,14 @@ app.run(['$rootScope', '$state', 'Auth', '$location', function($rootScope, $stat if (requiresLogin && !Auth.isLoggedIn()) { event.preventDefault(); - console.log('asdfasdfasdfasdfasdfasdfasdfasdf', toState); + console.log('stuff here ->', toState); + if (!angular.equals(toState.data.session, {})) { + var sess = toState.data.session.access_token; + console.log('WHERE', $rootScope.redirectedURL ); + Auth.add(sess) + $state.go("app." + $rootScope.redirectedURL); + } $state.go('splash-page', { 'toState': toState.name }); - } else { - // Auth.get(Auth.session); - } }); }]);