Show error on user deletion if not allowed

This commit is contained in:
Johannes Zellner
2020-03-06 12:23:50 -08:00
parent f1e0167e1b
commit d5930fd859
3 changed files with 8 additions and 9 deletions

View File

@@ -106,9 +106,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
return callback(new ClientError('Request cancelled by browser'));
}
// 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 === 401) return client.login();
if (status === 500 || status === 501) {
if (!client.offline) client.error(data);