diff --git a/src/components/confirm2FA/confirm2FA.tsx b/src/components/confirm2FA/confirm2FA.tsx index d9e30c7..1d97057 100644 --- a/src/components/confirm2FA/confirm2FA.tsx +++ b/src/components/confirm2FA/confirm2FA.tsx @@ -109,6 +109,8 @@ const Confirm2FA = () => { unblock(); back(); } else { + const has2fa = /HasTotpToken|Authenticated/.test(user?.state); + const Lost2FAModal = (props: any) => { const [disabledNew2FAButton, setDisabledNew2FAButton] = useState(true); return ( @@ -242,7 +244,10 @@ const Confirm2FA = () => { - + You have not setup 2FA yet! diff --git a/src/services/auth.ts b/src/services/auth.ts index e92d601..c793254 100644 --- a/src/services/auth.ts +++ b/src/services/auth.ts @@ -73,6 +73,10 @@ class AuthService { const settings = this.settings; this.userManager = new UserManager(settings); + // reset the user to force-fetch it via the session + // (may have been logged out in another session or due to timeout) + this.setUser(null); + Log.setLogger(console); Log.setLevel(Log.INFO); // set to DEBUG for more output }