generated from Nostrathomas0/nostrathomas0.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tom Schwartz
committed
Apr 9, 2024
1 parent
dd5775d
commit 31eaea7
Showing
3 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { getAuth, createUserWithEmailAndPassword, sendEmailVerification } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-auth.js"; | ||
const auth = getAuth(); | ||
|
||
function signUpAndSendVerification(email, password) { | ||
createUserWithEmailAndPassword(auth, email, password) | ||
.then((userCredential) => { | ||
// Signed in | ||
const user = userCrential.user; | ||
|
||
// Send Verification Email | ||
sendEmailVerification(user) | ||
.then(() => { | ||
// Email verification sent | ||
// Redirect user | ||
}); | ||
}) | ||
.catch((error) => { | ||
const errorCode = error.code; | ||
const errorMessage = error.message; | ||
// Handle errors | ||
// Display message | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters