Skip to content

Commit

Permalink
fix: only delete session if error is Unauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBobBobs authored and insertish committed Mar 13, 2024
1 parent 15e8e10 commit 472e6e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controllers/client/ClientController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/client/jsx/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down

0 comments on commit 472e6e0

Please sign in to comment.