fix: only delete session if error is Unauthorized

This commit is contained in:
Bob Bobs
2024-02-28 15:11:32 -07:00
committed by Paul Makles
parent 3ed0b46807
commit 9d170b5517
2 changed files with 3 additions and 2 deletions

View File

@@ -159,7 +159,7 @@ class ClientController {
})
.catch((err) => {
const error = takeError(err);
if (error === "Forbidden" || error === "Unauthorized") {
if (error === "Unauthorized") {
this.sessions.delete(user_id);
this.current = null;
this.pickNextSession();

View File

@@ -10,8 +10,9 @@ export function takeError(error: any): string {
case 429:
return "TooManyRequests";
case 401:
return "Unauthorized"
case 403:
return "Unauthorized";
return "Forbidden";
default:
return "UnknownError";
}