Skip to content

Commit

Permalink
Merge pull request #150 from Cavdy/bug-fix
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
Cavdy committed Sep 1, 2019
2 parents 3ce8ee2 + c6d48ac commit e978c2c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 43 deletions.
5 changes: 0 additions & 5 deletions frontend-app/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1293,11 +1293,6 @@ body,
align-items: center;
justify-content: center;
}

.wrapper {
height: 900px;
max-width: 1800px;
}
}

@media (max-width: 1140px) {
Expand Down
10 changes: 5 additions & 5 deletions frontend-app/js/signin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
});
};
Expand Down
68 changes: 35 additions & 33 deletions server/v1/services/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = `<div style='width:100%;text-align:center;'>
// <div style='color:#2196F3;background-color:#2196F3;color:#ffffff;padding:2rem 0;'>
// <h2>Welcome to Banka</h2>
// <h2>${verifyUser.rows[0].lastname} ${verifyUser.rows[0].firstname}</h2>
// </div>
// <br />
// We are happy to have you as part of the family.
// <br /><br />
// Please if you have any issues, do contact our customer care services
// <br /><br />
// Thank You.
// </div>
// `;

// await sendEmail
// .sendEmail('do_not_reply@banka.com',
// verifyUser.rows[0].email, 'Welcome to Banka', html);
const html = `<div style='width:100%;text-align:center;'>
<div style='color:#2196F3;background-color:#2196F3;color:#ffffff;padding:2rem 0;'>
<h2>Welcome to Banka</h2>
<h2>${verifyUser.rows[0].lastname} ${verifyUser.rows[0].firstname}</h2>
</div>
<br />
We are happy to have you as part of the family.
<br /><br />
Please if you have any issues, do contact our customer care services
<br /><br />
Thank You.
</div>
`;

await sendEmail
.sendEmail('do_not_reply@banka.com',
verifyUser.rows[0].email, 'Welcome to Banka', html);
returnStatus = 200;
returnSuccess = 'user successfully verified';
}
Expand Down Expand Up @@ -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},
// <br /><br />
// Thank you for registering with us, below is your verification key
// <br /><br />
// <a style='text-decoration:none;background-color:#2196F3;color:#ffffff;padding:1rem 1.5rem;' href="https://cavdy.github.io/Banka/login.html?secret=${secretToken}">Verify</a>
// <br /><br />
// If you can not click on the button above, copy this link <strong>https://cavdy.github.io/Banka/login.html?secret=${secretToken}</strong>
// <br /><br />
// Please we will never ask you for this verification key, do not share it with anyone.
// <br /><br />
// 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},
<br /><br />
Thank you for registering with us, below is your verification key
<br /><br />
<a style='text-decoration:none;background-color:#2196F3;color:#ffffff;padding:1rem 1.5rem;' href="https://ah-banka.herokuapp.com/login?secret=${secretToken}">Verify</a>
<br /><br />
If you can not click on the button above, copy this link <strong>https://ah-banka.herokuapp.com/login?secret=${secretToken}</strong>
<br /><br />
Please we will never ask you for this verification key, do not share it with anyone.
<br /><br />
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';
}
Expand Down

0 comments on commit e978c2c

Please sign in to comment.