🛂 Remove page reload on auth failure (#981)

This commit is contained in:
Alicia Sykes
2024-04-28 20:00:17 +01:00
parent 85de40d950
commit db9d7e362d
3 changed files with 22 additions and 17 deletions

View File

@@ -3,7 +3,7 @@ import sha256 from 'crypto-js/sha256';
import ConfigAccumulator from '@/utils/ConfigAccumalator';
import { cookieKeys, localStorageKeys, serviceEndpoints } from '@/utils/defaults';
import { InfoHandler, ErrorHandler, InfoKeys } from '@/utils/ErrorHandler';
import { logout } from '@/utils/Auth';
import { logout as authLogout } from '@/utils/Auth';
const getAppConfig = () => {
const Accumulator = new ConfigAccumulator();
@@ -22,7 +22,6 @@ class HeaderAuth {
this.users = auth.users;
}
/* eslint-disable class-methods-use-this */
login() {
return new Promise((resolve, reject) => {
const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;
@@ -44,6 +43,7 @@ class HeaderAuth {
}
});
} catch (e) {
ErrorHandler('Error while trying to login using header authentication', e);
reject(e);
}
}
@@ -51,8 +51,9 @@ class HeaderAuth {
});
}
// eslint-disable-next-line class-methods-use-this
logout() {
logout();
authLogout();
}
}