This is a simple authentication API using ExpressJS. Currently, it only provides an access token when a user signs in.
The API provides 3 routes:
POST /user/signin
: Parses theemail
andpassword
in the request body. If credentials are correct, an access token cookie is set.POST /user/signup
: Parses theusername
,email
, andpassword
fields of the request body. If the email already exists, status codeBAD REQUEST
is sent. Otherwise,INTERNAL SERVER ERROR
is sent if another kind of error occured orCREATED
if the signup was successful.GET /dashboard
: Simulates a dashboard. An access token cookie is expected in HTTP request. If the token isn't valid, a response withUNAUTHORIZED
status code is sent.