diff --git a/public/js/account.js b/public/js/account.js index 6c40131ae..b08b0a385 100644 --- a/public/js/account.js +++ b/public/js/account.js @@ -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.