fix: only delete session if error is Unauthorized
parent
15e8e10151
commit
4edcffe147
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue