Skip to content

Instantly share code, notes, and snippets.

@bonnie
Last active January 2, 2018 23:29
Show Gist options
  • Save bonnie/c1297cbfea3f1e2ccf775d81a4428a48 to your computer and use it in GitHub Desktop.
Save bonnie/c1297cbfea3f1e2ccf775d81a4428a48 to your computer and use it in GitHub Desktop.

Work Plan 2018-01-02

Weekly Goal

Work on auth snapshot goal

Specifications

[https://curriculum.learnersguild.org/Phases/Practice/Modules/Snapshot-Auth/] (https://curriculum.learnersguild.org/Phases/Practice/Modules/Snapshot-Auth/)

Implementation Plan

Update Data Model

  • Add properties to contacts table:
    • role
    • password
    • username

Views

  • 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
  • Add login view
  • add new_contact.ejs

Routes

  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment