From 663b94d0e3520e6f94e61a6aaa76f8502b277716 Mon Sep 17 00:00:00 2001 From: MassiGy Date: Mon, 14 Mar 2022 20:46:52 +0100 Subject: [PATCH 1/3] Fixed DOM Input Element Access --- src/auth/signup/signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/signup/signup.js b/src/auth/signup/signup.js index 3918a9d..66239a3 100644 --- a/src/auth/signup/signup.js +++ b/src/auth/signup/signup.js @@ -2,7 +2,7 @@ const signupForm = document.getElementById("signup-form"); signupForm.onsubmit = () => { - const username = document.getElementById("password").username; + const username = document.getElementById("username").value; const email = document.getElementById("email").value; const password = document.getElementById("password").value; From 99dae70d3da2041fa27a21c015466501523a9740 Mon Sep 17 00:00:00 2001 From: MassiGy Date: Mon, 14 Mar 2022 21:37:18 +0100 Subject: [PATCH 2/3] +User Feedback As we know, when a user registers, an email will be sent to him, so it will be better if we tell the user before redirecting him to the next page. I achieved this resault by a simple Browser alert. Massiles. --- src/auth/signup/signup.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/auth/signup/signup.js b/src/auth/signup/signup.js index 66239a3..9598e87 100644 --- a/src/auth/signup/signup.js +++ b/src/auth/signup/signup.js @@ -23,6 +23,7 @@ signupForm.onsubmit = () => { if (data.status == 200) { Cookies.set('token', data.json.token); + alert("Email has been sent to you, Please go and view it to validate your email address") window.location.href = "/dashboard"; } else if (data.status == 403) { From e0d4c1a1b1d71347a86f320b6096b9cfab73a628 Mon Sep 17 00:00:00 2001 From: MassiGy Date: Mon, 14 Mar 2022 21:43:33 +0100 Subject: [PATCH 3/3] small user feedback tweaks --- src/auth/signup/signup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth/signup/signup.js b/src/auth/signup/signup.js index 9598e87..1ae0450 100644 --- a/src/auth/signup/signup.js +++ b/src/auth/signup/signup.js @@ -23,7 +23,7 @@ signupForm.onsubmit = () => { if (data.status == 200) { Cookies.set('token', data.json.token); - alert("Email has been sent to you, Please go and view it to validate your email address") + alert("Email has been sent to you, Please view it to validate your email address. ( The email will expire in 4 days )") window.location.href = "/dashboard"; } else if (data.status == 403) {