Skip to content

Latest commit

 

History

History
68 lines (52 loc) · 1.12 KB

README.md

File metadata and controls

68 lines (52 loc) · 1.12 KB

Lecture 22 - Authentication System from Pseudo Code to Real Code

Pseudo Code

Authentication

Registration Process:

Start
name = input()
email = input()
password = input()
if name && email && password is invalid:
  return 400 error

user = find user with email
if user found:
  return 400 error

hash = hash password
user = save name, email, hash to user model
return 201
End

Login Process:

Start
email = input()
password = input()

user = find user with email
if user not found:
  return 400 error

if password not equal to user hash:
  return 400 error

token = generate token using user
return token
End

Reset Password:

Start
new-password = Input()
old-password = Input()
TODO
                                     I
if old-password not equal to user.hash password:
   return 400 error
else hashNewPassword = hash new-password
   save hashNewPassword
   return 201
End

Progress:
Follow this link to check the progress

Source Code
Click Here