From a0c5ade54d05b7d902028e3097a76c05bb13bdeb Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 23 Jun 2023 16:44:18 +0200 Subject: [PATCH] signing out after user changed email --- frontend/src/ts/popups/simple-popups.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/ts/popups/simple-popups.ts b/frontend/src/ts/popups/simple-popups.ts index be9f9cd03..0568146ae 100644 --- a/frontend/src/ts/popups/simple-popups.ts +++ b/frontend/src/ts/popups/simple-popups.ts @@ -300,6 +300,7 @@ list["updateEmail"] = new SimplePopup( async (_thisPopup, password, email, emailConfirm) => { try { const user = Auth?.currentUser; + if (!Auth) return; if (!user) return; if (email !== emailConfirm) { Notifications.add("Emails don't match", 0); @@ -325,9 +326,7 @@ list["updateEmail"] = new SimplePopup( } Notifications.add("Email updated", 1); - setTimeout(() => { - window.location.reload(); - }, 3000); + AccountController.signOut(); } catch (e) { const typedError = e as FirebaseError; if (typedError.code === "auth/wrong-password") {