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); - } }); }]);