Make login work after user becomes admin

This commit is contained in:
Girish Ramakrishnan
2019-05-10 09:45:37 -07:00
parent 3d8ec5531c
commit b22dba00a2

View File

@@ -37,7 +37,9 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
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 (!client.offline) client.error(data);
client.offline = true;