fix: only delete session if error is Unauthorized

This commit is contained in:
Bob Bobs authored and Paul Makles committed 2024-03-13 22:55:12 +00:00
1 parent 15e8e10151
commit 472e6e07b5
2 files changed
+3 -2

No files matched your search

+1 -1
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();
+2 -1
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";
}