Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Feature: Register & Login

sjagoori edited this page Jun 20, 2020 · 3 revisions

Registration

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

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.

Your information

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

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.

The technicals

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'

Sources