claurennt / backend-auth-API-with_AWS_S3

A tiny API to practice authorization and authentication with JWT

Home Page:https://claurennt-auth-api.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A tiny API to practice authorization and authentication with JWT

https://claurennt-auth-api.herokuapp.com/


Languages

Language:JavaScript 82.9%Language:HTML 17.0%Language:Procfile 0.1%