From b22dba00a278212923425eacc92b8bb2baa14e3a Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 10 May 2019 09:45:37 -0700 Subject: [PATCH] Make login work after user becomes admin --- src/js/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/js/client.js b/src/js/client.js index 152ce66c2..ec6835739 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -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;