mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 07:36:09 +08:00
verification sending fucntion
sending verification on sign up
This commit is contained in:
parent
7c2dca89c9
commit
a6eb637b49
1 changed files with 14 additions and 0 deletions
|
@ -140,6 +140,7 @@ function signUp() {
|
|||
.collection("users")
|
||||
.doc(usr.uid)
|
||||
.set({ name: nname }, { merge: true });
|
||||
usr.sendEmailVerification();
|
||||
showNotification("Account created", 2000);
|
||||
$("#menu .icon-button.account .text").text(nname);
|
||||
try {
|
||||
|
@ -192,6 +193,19 @@ function signOut() {
|
|||
});
|
||||
}
|
||||
|
||||
function sendVerificationEmail() {
|
||||
firebase
|
||||
.auth()
|
||||
.currentUser.sendEmailVerification()
|
||||
.then((e) => {
|
||||
showNotification("Email sent", 3000);
|
||||
})
|
||||
.catch((e) => {
|
||||
showNotification("Error: " + e.message, 3000);
|
||||
console.error(e.message);
|
||||
});
|
||||
}
|
||||
|
||||
firebase.auth().onAuthStateChanged(function (user) {
|
||||
if (user) {
|
||||
// User is signed in.
|
||||
|
|
Loading…
Add table
Reference in a new issue