Skip to content

claurennt/backend-auth-API-with_AWS_S3

Repository files navigation

Welcome to my tiny API to test Authorization/Authentication

API Endpoints:

POST /users/register

Creates a new user -> Expects an email, username and password in the body of the request + a "profile_pic" file {"email": $email, "username": $username, "password": $password, $profile_pic: File} and returns a response with an auth token in the headers

POST /auth/login

Authenticates an existing user -> Expects a username and password in the body of the request {"username":$username, "password":$password} and returns a response with an auth token in the headers

GET /users

Returns all users in the database* (*Admin rights required) -> Expects an Admin token in the headers Authorization: Bearer $token

DELETE /users

Delete all users from the database* (*Admin rights required) -> Expects an Admin token in the headers Authorization: Bearer $token

GET /users/me

Returns information about the user making the request -> Expects an auth token in the headers Authorization: Bearer $token

PATCH /users/me

Updates fields of user making the request -> Expects a body containing the fields the user wants to update and an auth token in the headers Authorization: Bearer $token

DELETE /users/me

Deletes the user making the request -> Expects an auth token in the headers Authorization: Bearer $token

Releases

No releases published

Packages

No packages published