Toacin / PizzaByte

1 stars 0 forks source link

22 create routes and controllers to create and login users #23

Closed Toacin closed 4 days ago

Toacin commented 4 days ago

Description

Describe the purpose of this pull request This PR adds two new controllers and routes, 1 for signing up user and 1 for logging in user. A new file added to sign jwt tokens on successful authentication. Middleware function also added to ensure routes are authenticated before retrieving an authentication-required resource

Changes Proposed

Briefly describe the changes introduced by this pull request User model now has instance method to check password validity, and also hook to hash password first

Related Issue

Does this PR close any issue? Closes #22