From 340db1ceccf9c93f1d45d29f954c65c8b4e5df3b Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 21 Jul 2020 23:33:21 +0100 Subject: [PATCH] added 'not verified' info to the account page --- public/index.html | 22 +++++++++++----------- public/js/account.js | 12 ++++++++---- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/public/index.html b/public/index.html index 4dd0e8225..6dddcbdf2 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ Monkey Type - + @@ -1353,17 +1353,17 @@ - + - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/public/js/account.js b/public/js/account.js index b08b0a385..ac24d8413 100644 --- a/public/js/account.js +++ b/public/js/account.js @@ -194,11 +194,10 @@ function signOut() { } function sendVerificationEmail() { - firebase - .auth() - .currentUser.sendEmailVerification() + let cu = firebase.auth().currentUser; + cu.sendEmailVerification() .then((e) => { - showNotification("Email sent", 3000); + showNotification("Email sent to " + cu.email, 4000); }) .catch((e) => { showNotification("Error: " + e.message, 3000); @@ -209,6 +208,11 @@ function sendVerificationEmail() { firebase.auth().onAuthStateChanged(function (user) { if (user) { // User is signed in. + if (user.emailVerified === false) { + $(".pageAccount .content").prepend( + `

Your account is not verified. Click here to resend the verification email.` + ); + } updateAccountLoginButton(); accountIconLoading(true); db_getUserSnapshot().then((e) => {