diff --git a/config.js b/config.js index 0622890..a286816 100644 --- a/config.js +++ b/config.js @@ -42,7 +42,8 @@ angular.module('flashy', [ if (rejection.status == 403) { console.log(rejection); if (rejection.data && rejection.data.detail == 'Please verify your email before continuing') { - $rootScope.$broadcast('account_locked'); + UserService.showLockedMessage(); + UserService.logout(); } } return $q.reject(rejection); @@ -53,10 +54,9 @@ angular.module('flashy', [ $urlRouterProvider.otherwise('/404'); var auth_resolve = { authorize: function($q, $state, $stateParams, UserService) { - if (UserService.noAuthRequired($state)) { - console.log('no auth state ' + $state.name); - return $state.go(state.name); - } + if (UserService.noAuthRequired($state)) { + return console.log('no auth state ' + $state.name); + } console.log('resolving user before continuing for ' + $state.name); var redirectAsNeeded = function() { if (!UserService.isLoggedIn()) { @@ -65,7 +65,7 @@ angular.module('flashy', [ $state.go('login'); } if (!UserService.authorizedFor($state, $stateParams)) { - console.log('user not authorized for ' + $state.name); + console.log('user not authorized for ' + $state.name); $state.go('addclass'); } }; diff --git a/home.html b/home.html index 45f176f..936a903 100644 --- a/home.html +++ b/home.html @@ -27,24 +27,25 @@
  • Add Class
  • -