Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BE: Signup / Login API Routes #26

Open
bonnieli opened this issue Nov 9, 2020 · 0 comments
Open

BE: Signup / Login API Routes #26

bonnieli opened this issue Nov 9, 2020 · 0 comments
Assignees
Labels

Comments

@bonnieli
Copy link
Contributor

bonnieli commented Nov 9, 2020

  • Create a Register route (POST)
    • this will create a new user, return 201
    • validation on the back-end - password should be atleast 6 characters, required fields (email, name), checking confirm and password are the same
    • simple password validation (>6 chars)
    • Save the JWT token in a cookie (should login user as well)
    • Use httpOnly cookies
  • Create a Login route (POST)
    • verify username and password
    • return 4xx if things are incorrect
    • Save the JWT token in a cookie
  • On successful auth: return token and user object
  • User model, don't want to save password directly on the database (hash/salt before we save them)
  • Add a basic auth middleware / decorator - we can easily create authenticated routes and get the user object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants