/DjangoAuth

Django rest service for registering users, logging in and logging out.

Primary LanguageJavaScript

DjangoAuth

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 and email
  • 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 and password
  • POST /api/auth/logout
    • destroys the access token for the user
    • header should have Authorization with value Token <user access token>
  • GET /api/auth/user
    • gets info for the user
    • header should have Authorization with value Token <user access token>