Fix missing redirect after login (#1592)

Each unauthorized error was caught by the token expired handler, which has reset the whole query state and this leads sometimes to a missing redirect after login.
This commit is contained in:
Sebastian Sdorra
2021-03-16 16:13:43 +01:00
committed by GitHub
parent ce0e94098e
commit 9ef076fb2f
8 changed files with 98 additions and 19 deletions

View File

@@ -72,14 +72,18 @@ export class BackendError extends Error {
export class UnauthorizedError extends Error {
statusCode: number;
constructor(message: string, statusCode: number) {
super(message);
this.statusCode = statusCode;
}
}
export class TokenExpiredError extends UnauthorizedError {}
export class ForbiddenError extends Error {
statusCode: number;
constructor(message: string, statusCode: number) {
super(message);
this.statusCode = statusCode;