Skip to content

Commit

Permalink
d
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Schwartz committed Nov 8, 2024
1 parent 6f0a673 commit 61afb73
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions assets/js/firebaseAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 61afb73

Please sign in to comment.