From 0c65d0c072d5ce92d4070e1fdd3d964f816724c8 Mon Sep 17 00:00:00 2001 From: Andrew Buss Date: Sun, 31 May 2015 17:44:58 -0700 Subject: [PATCH] try to fix behavior when the account is locked --- config.js | 12 ++++----- home.html | 25 +++++++++--------- scripts/FeedController.js | 4 +-- scripts/RootController.js | 9 ------- scripts/UserService.js | 26 +++++++++++------- styles/flashy.css | 8 ------ templates/settings.html | 67 ++++++++++++++++++++++++----------------------- 7 files changed, 72 insertions(+), 79 deletions(-) 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
  • -