1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

Fixes issue with auth login redirect failure

This commit is contained in:
Harvey Kandola 2017-07-17 10:28:32 +01:00
parent a8e8d141d2
commit 3d6727ff4c
4 changed files with 10 additions and 6 deletions

View file

@ -45,7 +45,7 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
if (is.not.include(next, '/auth/')) {
window.location.href= next;
}
}
}
},

View file

@ -40,14 +40,20 @@ function getAppUrl(domain) {
}
function isAjaxAccessError(reason) {
if (typeof reason === "undefined" || typeof reason.errors === "undefined") {
if (typeof reason === "undefined") {
return false;
}
if (reason.errors.length > 0 && (reason.errors[0].status === "401" || reason.errors[0].status === "403")) {
if (reason.message === 'Ajax authorization failed') {
return true;
}
if (typeof reason.errors === "undefined") {
if (reason.errors.length > 0 && (reason.errors[0].status === "401" || reason.errors[0].status === "403")) {
return true;
}
}
return false;
}