This repository has been archived by the owner on Mar 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Auth Endpoint API Reference
Patrick Tone edited this page Apr 4, 2017
·
3 revisions
Method | Endpoint | Verb | Description |
---|---|---|---|
Login | /auth |
POST | Start a session with a valid email/password and returns a token |
Logout | /auth |
DELETE | Given a token, destroy the given token |
Create | /auth/create |
POST | Create a auth_user with a email/password |
Role | /auth |
GET | Given a token, returns the associated user role |
Start a session by passing a valid email/password and returns a token.
-
Endpoint:
/auth
-
Verb: POST
-
Request:
{ "email" : STRING, "password": STRING }
-
Response:
STATUS 201 - Success
{ "token": STRING }
STATUS 401 - Error
{ "message": STRING }
Given a token, destroy the given token.
-
Endpoint:
/auth
-
Verb: DELETE
-
Request:
-
Response:
STATUS 201 - Success
STATUS 401 - Error
{ "message": STRING }
Create a auth_user
with a email/password and role.
-
Endpoint:
/auth/create
-
Verb: POST
-
Request:
{ "email" : STRING, "password": STRING, "role": ENUM [STUDENT, COORDINATOR] }
-
Response:
STATUS 201 - Success
STATUS 401 - Error
{ "message": STRING }
Given a token, returns the associated user role.
-
Endpoint:
/auth
-
Verb: GET
-
Request:
{ "token" : STRING }
-
Response:
STATUS 201 - Success
{ "role": ENUM [STUDENT, COORDINATOR] }
STATUS 401 - Error
{ "message": STRING }
test sidebar