Skip to content

Commit

Permalink
After logout, show login screen instead of session picker
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Nov 30, 2023
1 parent 5a9b5d2 commit 5e30126
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontend/iframe/viewmodels/RootViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,16 @@ export class RootViewModel extends ViewModel<SegmentType, Options> {
const isLogin = this.navigation.path.get("login");
const logoutSessionId = this.navigation.path.get("logout")?.value;
const isForcedLogout = this.navigation.path.get("forced")?.value;
const sessionId = this.navigation.path.get("session")?.value;
const loginToken = this.navigation.path.get("sso")?.value;

let sessionId = this.navigation.path.get("session")?.value;
if (sessionId === true) {
// When logging out, we end up here (sessionId = true).
// Since user is now logged out and as there can only be a single session,
// we want to show the login screen directly.
sessionId = null;
}

if (isLogin) {
if (this.activeSection !== Section.Login) {
this._showLogin(undefined);
Expand All @@ -121,10 +128,6 @@ export class RootViewModel extends ViewModel<SegmentType, Options> {
if (this.activeSection !== Section.Logout) {
this._showLogout(logoutSessionId);
}
} else if (sessionId === true) {
if (this.activeSection !== Section.SessionPicker) {
void this._showPicker();
}
} else if (sessionId) {
const singleRoomId = await this.getSingleRoomId();
if (singleRoomId) {
Expand Down

0 comments on commit 5e30126

Please sign in to comment.