Work on auth snapshot goal
[https://curriculum.learnersguild.org/Phases/Practice/Modules/Snapshot-Auth/] (https://curriculum.learnersguild.org/Phases/Practice/Modules/Snapshot-Auth/)
- Add properties to
contacts
table:role
password
username
- Add sign-up template
- create view file (ejs template)
sign_up.ejs
- Add markup for
- form for user and password
- form method will be POST
- form action will be
/sign_up
- create view file (ejs template)
- Add login view
- add
new_contact.ejs
-
define route/endpoint for serving sign-up page
- the point of this route: rendering sign up form
- GET route
/sign_up
- render the ejs template
sign_up.ejs
-
define route/endpoint for receiving sign_up page form
- the point of this route: add user/password to database
- POST route
/sign_up
- logic for validating new user info
- store new user info (encrypt)
- redirect user to
/user/:user_id
route
-
define route for
/contacts/new
- if not admin, return status code 403
- render a form to create a new contact
new_contact.ejs