-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: Register & Login
To deliver a personalized experience, it is necessary to have a registration system. During the registration process, a user can create their very own account using their email and password. Later on, they set their information and their preferences.
The registration starts with the basics, a few input fields for the user to fill their information in. These are the first and last names along with an email address & password.
To make the matching working, you eventually need some information to match on. On these pages, the user can enter their personal information as well as their dating preferences.
Once all filled in, your account gets created, and you will be logged in. The app redirects you to your very own profile page where you can start your journey.
The login is pretty straight forward; you enter the email you've registered with and if the information is correct, you will be logged in! If not, you'll see an error message regarding your credentials.
In order to make this all work, we have used the package body-parser to retrieve data from the forms during the registration. The data between the pages are saved in a session, we have used express-session for this part. With every step, the session gets additions until it's complete at step 3.
{
fname: 'Bruce',
lname: 'Wayne',
email: 'bruce@wayne.enterprices.com',
password: 'superPass',
personal: { skillLevel: 'amateur', occupation: 'fullStack', languages: 'C' },
perefences: { skillLevel: 'expert', occupation: 'front-end', languages: 'Javascript', 'Python' }
}
Right before this gets send off to the database, the password gets hashed using the package BCrypt.
* before hashing
password: 'superPass'
* after hashing
password: '$2b$10$dDI6iJ26rjsO2yPrIUmhzuSiNtfpy/uz0grZSn7hRrrtsa8jEY7US'
- npm: bcrypt. (2020, June 8). Retrieved from https://www.npmjs.com/package/bcrypt
- npm: body-parser. (2019, April 26). Retrieved from https://www.npmjs.com/package/body-parser
- npm: express-session. (2020, April 17). Retrieved from https://www.npmjs.com/package/express-session