diff --git a/frontend-app/css/style.css b/frontend-app/css/style.css index 19f8c15..d905dc6 100644 --- a/frontend-app/css/style.css +++ b/frontend-app/css/style.css @@ -1293,11 +1293,6 @@ body, align-items: center; justify-content: center; } - - .wrapper { - height: 900px; - max-width: 1800px; - } } @media (max-width: 1140px) { diff --git a/frontend-app/js/signin.js b/frontend-app/js/signin.js index aedc2ac..4d80281 100644 --- a/frontend-app/js/signin.js +++ b/frontend-app/js/signin.js @@ -143,12 +143,12 @@ const postApi = (url, data) => { notifyMsg.parentElement.classList.remove('notify-show'); }, 5000); } else if (data1.status === 201) { - sessionStorage.setItem('token', data1.data.token); - sessionStorage.setItem('email', data1.data.email); - sessionStorage.setItem('id', data1.data.id); + sessionStorage.setItem('token', data1.data.user.token); + sessionStorage.setItem('email', data1.data.user.email); + sessionStorage.setItem('id', data1.data.user.id); sessionStorage.setItem('login', login); - sessionStorage.setItem('avatar', data1.data.avatar); - getUserApi(`${api}/users/${data1.data.id}`); + sessionStorage.setItem('avatar', data1.data.user.avatar); + getUserApi(`${api}/users/${data1.data.user.id}`); } }); }; diff --git a/server/v1/services/auth.js b/server/v1/services/auth.js index 9b38995..ab2a662 100644 --- a/server/v1/services/auth.js +++ b/server/v1/services/auth.js @@ -46,6 +46,8 @@ const AuthService = { user.user.firstName = emailresponse.rows[0].firstname; user.user.lastName = emailresponse.rows[0].lastname; user.user.email = emailresponse.rows[0].email; + user.user.type = emailresponse.rows[0].type; + user.user.isAdmin = emailresponse.rows[0].isadmin; user.user.token = token; user.user.avatar = emailresponse.rows[0].avatar; returnStatus = 201; @@ -94,23 +96,23 @@ const AuthService = { .dbConnect('UPDATE users SET verify=$1, secretToken=$2 WHERE secretToken=$3', [true, '', vToken]); if (updateUser.command === 'UPDATE') { - // const html = `
- //
- //

Welcome to Banka

- //

${verifyUser.rows[0].lastname} ${verifyUser.rows[0].firstname}

- //
- //
- // We are happy to have you as part of the family. - //

- // Please if you have any issues, do contact our customer care services - //

- // Thank You. - //
- // `; - - // await sendEmail - // .sendEmail('do_not_reply@banka.com', - // verifyUser.rows[0].email, 'Welcome to Banka', html); + const html = `
+
+

Welcome to Banka

+

${verifyUser.rows[0].lastname} ${verifyUser.rows[0].firstname}

+
+
+ We are happy to have you as part of the family. +

+ Please if you have any issues, do contact our customer care services +

+ Thank You. +
+ `; + + await sendEmail + .sendEmail('do_not_reply@banka.com', + verifyUser.rows[0].email, 'Welcome to Banka', html); returnStatus = 200; returnSuccess = 'user successfully verified'; } @@ -306,22 +308,22 @@ const AuthService = { [email, fname, lname, hash, userData.type, userData.isAdmin, 'false', secretToken, mAvatar]); if (response.command === 'INSERT') { - // const html = `Hi ${response.rows[0].lastname}, - //

- // Thank you for registering with us, below is your verification key - //

- // Verify - //

- // If you can not click on the button above, copy this link https://cavdy.github.io/Banka/login.html?secret=${secretToken} - //

- // Please we will never ask you for this verification key, do not share it with anyone. - //

- // Thank You. - // `; - - // await sendEmail - // .sendEmail('do_not_reply@banka.com', - // response.rows[0].email, 'Verify your email', html); + const html = `Hi ${response.rows[0].lastname}, +

+ Thank you for registering with us, below is your verification key +

+ Verify +

+ If you can not click on the button above, copy this link https://ah-banka.herokuapp.com/login?secret=${secretToken} +

+ Please we will never ask you for this verification key, do not share it with anyone. +

+ Thank You. + `; + + await sendEmail + .sendEmail('do_not_reply@banka.com', + response.rows[0].email, 'Verify your email', html); returnStatus = 201; returnSuccess = 'Successfully signed up, check your email for verification'; }