/auth-for-newbs-v2

Primary LanguageJavaScriptMIT LicenseMIT

Auth For Newbs - Part 6+

This is a continuation of the Auth For Newbs series on YouTube. In this continuation, we will work on the stretch goals and making the code more production ready.

  • Route to list all users
    • GET /api/v1/users
  • Route to update a user
    • PATCH /api/v1/users/:id
  • Add a role property to users when created
    • Role will default 'user'
  • Add a active property to users when created
    • Active will default true
  • Seed the DB with an admin user
    • Insert user with role 'admin'
  • Restrict GET /api/v1/users to only users with admin role
    • List all users
  • Restrict PATCH /api/v1/users/:id to only users with admin role
    • Update a user
  • Prevent inactive users from logging in
  • Route to create a user
    • POST /api/v1/users
  • Restrict POST /api/v1/users to only users with admin role
    • Create a user