From a6eb637b49e9d57239e2a854f3a1ab416a825a3c Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 21 Jul 2020 22:50:38 +0100 Subject: [PATCH] verification sending fucntion sending verification on sign up --- public/js/account.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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.