mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-26 00:50:56 -05:00
merge: branch 'master' into production
This commit is contained in:
commit
c9066aba2d
2 changed files with 11 additions and 2 deletions
|
@ -10,6 +10,7 @@ import Auth from "../../mobx/stores/Auth";
|
||||||
import { resetMemberSidebarFetched } from "../../components/navigation/right/MemberSidebar";
|
import { resetMemberSidebarFetched } from "../../components/navigation/right/MemberSidebar";
|
||||||
import { modalController } from "../modals/ModalController";
|
import { modalController } from "../modals/ModalController";
|
||||||
import Session from "./Session";
|
import Session from "./Session";
|
||||||
|
import { takeError } from "./jsx/error";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls the lifecycles of clients
|
* Controls the lifecycles of clients
|
||||||
|
@ -156,12 +157,20 @@ class ClientController {
|
||||||
configuration: this.configuration!,
|
configuration: this.configuration!,
|
||||||
knowledge,
|
knowledge,
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((err) => {
|
||||||
|
const error = takeError(err);
|
||||||
if (error === "Forbidden" || error === "Unauthorized") {
|
if (error === "Forbidden" || error === "Unauthorized") {
|
||||||
this.sessions.delete(user_id);
|
this.sessions.delete(user_id);
|
||||||
|
this.current = null;
|
||||||
|
this.pickNextSession();
|
||||||
state.auth.removeSession(user_id);
|
state.auth.removeSession(user_id);
|
||||||
modalController.push({ type: "signed_out" });
|
modalController.push({ type: "signed_out" });
|
||||||
session.destroy();
|
session.destroy();
|
||||||
|
} else {
|
||||||
|
modalController.push({
|
||||||
|
type: "error",
|
||||||
|
error,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ export default class Session {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.continueLogin(data);
|
await this.continueLogin(data);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue