diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-11-03 14:00:14 +0100 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2015-11-03 14:00:14 +0100 |
commit | 8da9557f66bcbaa91f540d44f7175a9e2436fa9b (patch) | |
tree | 3dd1a3422095a728245141061f3dc134de66906d /web-ui/app/js | |
parent | 484c4c31feaa3020932d45d5e0da2b4605cf96d1 (diff) |
Redirect to / if ajax request returns 401 status
- see issue pixelated/project-issues#162
- move test code to monitored_ajax_call.spec.js
Diffstat (limited to 'web-ui/app/js')
-rw-r--r-- | web-ui/app/js/helpers/monitored_ajax.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/web-ui/app/js/helpers/monitored_ajax.js b/web-ui/app/js/helpers/monitored_ajax.js index d05fdc4c..1cb720de 100644 --- a/web-ui/app/js/helpers/monitored_ajax.js +++ b/web-ui/app/js/helpers/monitored_ajax.js @@ -54,6 +54,8 @@ define(['page/events', 'views/i18n', 'helpers/browser'], function (events, i18n, if (xmlhttprequest.status === 302) { var redirectUrl = xmlhttprequest.getResponseHeader('Location'); browser.redirect(redirectUrl); + }else if (xmlhttprequest.status === 401) { + browser.redirect('/'); } }.bind(this)); |