Skip to content

Resolve "Authentication JWT"

Priyadarshini Saha requested to merge 79-authentication-jwt into main

Description

Added JWT authentication for users with HTTP cookies

Issue

Issue 79

Feature

API Endpoints: 1. Login

  • Endpoint: http://localhost:8000/user-auth/login [POST]
  • Request Body:
{
    "email": "samika@gmail.com",
    "password": "samika"
}
  • Response: User + HTTP Cookie

2. Registration

  • Endpoint: http://localhost:8000/user-auth/register [POST]
  • Request Body:
{
    "username": "priya",
    "email": "priya@gmail.com",
    "password": "priyadarshini",
    "firstname": "priya",
    "lastname": "saha",
    "occupation": "student"
}
  • Response Body: User
  1. User
  • Endpoint: http://localhost:8000/user-auth/user [GET]
  • Response Body: User
  1. Logout
  • Endpoint: http://localhost:8000/user-auth/logout [POST]
  • Request Body: None
  • Response Body: None

Tophatting

New postman collection pinned to discord

Expected current behavior

What should you see or expect when you test this feature?

Changes

Added JWT authentication

Screenshots

Add any screenshots required

Design Patterns

REST API

Deviations

Were there any deviations from the original design or architecture plan. If yes, what were they ?

Additional

  • Unit test written
  • Meets requirements
  • Cross-browser tested
  • Added/updated documentation as needed
  • Camel case style used

Closes #79 (closed)

Merge request reports