02/03: move to / when error 403
This is an automated email from the git hooks/post-receive script. unknown user pushed a commit to branch devel in repository Pollen. commit 4552378110b7168c87ef2a249db07c20cbde6846 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu May 22 16:29:33 2014 +0200 move to / when error 403 --- pollen-ui-angular/src/main/webapp/js/app.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pollen-ui-angular/src/main/webapp/js/app.js b/pollen-ui-angular/src/main/webapp/js/app.js index 6737d15..0794019 100644 --- a/pollen-ui-angular/src/main/webapp/js/app.js +++ b/pollen-ui-angular/src/main/webapp/js/app.js @@ -27,7 +27,7 @@ angular.module('pollen', ['pollenServices', 'ngRoute', 'pollControllers', 'userC $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; }]) -.factory('httpInterceptor', ['$q', '$rootScope', 'SessionStorage', function ($q, $rootScope, SessionStorage) { +.factory('httpInterceptor', ['$q', '$rootScope', '$location', 'SessionStorage', function ($q, $rootScope, $location, SessionStorage) { return { request: function($config) { // set locale with browser preference @@ -49,6 +49,10 @@ angular.module('pollen', ['pollenServices', 'ngRoute', 'pollControllers', 'userC //error login or sessionToken $rootScope.$broadcast('sessionExpired'); } + if (response.status === 403) { + //access forbidden + $location.path('/'); + } return $q.reject(response); } }; -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.
participants (1)
-
Chorem.org scm