From 61afb7300595192888270a8d7016fc030ceae1aa Mon Sep 17 00:00:00 2001 From: Tom Schwartz Date: Fri, 8 Nov 2024 09:26:00 +0100 Subject: [PATCH] d --- assets/js/firebaseAuth.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/js/firebaseAuth.js b/assets/js/firebaseAuth.js index 60cbb7b..9bbeb1b 100644 --- a/assets/js/firebaseAuth.js +++ b/assets/js/firebaseAuth.js @@ -154,15 +154,21 @@ async function signIn(email, password) { // Set the JWT token as a cookie for subdomain access setBackendAuthToken(jwtToken); console.log("JWT token set as cookie successfully"); + + // Alert user of successful sign-in + alert("Sign-in successful! You are now authenticated."); } else { console.error("No JWT token found in Firestore for user:", userId); + alert("Sign-in failed: Unable to retrieve JWT token."); } } catch (error) { - console.error("Error signing in:", error); - alert('Sign-in failed: ' + error.message); + // Log the error and show an alert to the user if sign-in fails + console.error("Error during sign-in process:", error); + alert("Sign-in failed: " + error.message); } } + async function sendPasswordResetEmail(email) { try { await auth.sendPasswordResetEmail(email);