-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registration page connected #1140
base: master
Are you sure you want to change the base?
Conversation
@salahlalami Can you have a look at this? |
@@ -2,7 +2,7 @@ const bcrypt = require('bcryptjs'); | |||
const jwt = require('jsonwebtoken'); | |||
|
|||
const authUser = async (req, res, { user, databasePassword, password, UserPasswordModel }) => { | |||
const isMatch = await bcrypt.compare(databasePassword.salt + password, databasePassword.password); | |||
const isMatch = await bcrypt.compare(password, databasePassword.password); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should stick to the existing hashing logic here otherwise admin login will fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I will adjust this. Thanks for bringing this into view.
// authUser if your has correct password | ||
const salt = await bcrypt.genSalt(10); | ||
console.log(salt) | ||
const hashedPassword = await bcrypt.hash(password, salt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with the comment above, we could reuse existing hashing logic from here. Maybe @salahlalami can confirm
const mongoose = require('mongoose'); | ||
|
||
const checkAndCorrectURL = require('./checkAndCorrectURL'); | ||
const sendMail = require('./sendMail'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we use email sending logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @H9660 I think you've done nice work implementing registration workflow 😃 I'd just check hashing and email sending logic as in the comments and eventually consult with other maintainers.
Hi @lukasz1mroz. Thanks. I will check in these issues and make necessary changes. |
Hi @lukasz1mroz. I have reverted the password hash logic. Also I have email sending logic on every registration. Please find it here: #1143 |
@salahlalami please merge this asap. We have to fix more issues that are related to sign up page. |
Hi @salahlalami . Please merge #1143 for this issue as it's the latest one. |
Description
Users were facing issues as there was no way to register a new user. So created a pipeline for the same.
Related Issues
This PR solves the issue: #1136.
Steps to Test
Provide steps on how to test the changes introduced in this pull request.
-> Run on localhost
-> Go to the login page
-> There would be a register button. Click on it and you will be redirected to the registration form.
Screenshots (if applicable)
Here is the demo of the registration page.
c4ec2ad0-6156-4186-ba7d-f03d05c933bd.webm
Checklist