Django rest service for registering users, logging in and logging out. Needed for capstone later.
backend directory contains the REST API for handling authentication and authorization.
frontend directory contains a basic React js app with a form for loggin in.
Endpoints:
POST /api/auth/register
- register a user with a username, email and password
- request body should be a JSON object with
username
,password
andemail
POST /api/auth/login
- creates a token for the user if the credentials could be authenticated
- request body should be a JSON object with
username
andpassword
POST /api/auth/logout
- destroys the access token for the user
- header should have
Authorization
with valueToken <user access token>
GET /api/auth/user
- gets info for the user
- header should have
Authorization
with valueToken <user access token>