Make login work after user becomes admin
This commit is contained in:
@@ -37,7 +37,9 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
|||||||
return callback(new ClientError('Request cancelled by browser'));
|
return callback(new ClientError('Request cancelled by browser'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status === 401) return client.login();
|
// 401 is when the token is invalid. 403 can happen when the token is valid but missing scopes (like when user became admin)
|
||||||
|
// re-login will make the code get a new token
|
||||||
|
if (status === 401 || status === 403) return client.login();
|
||||||
if (status >= 500) {
|
if (status >= 500) {
|
||||||
if (!client.offline) client.error(data);
|
if (!client.offline) client.error(data);
|
||||||
client.offline = true;
|
client.offline = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user