Island: Add docstrings to Authenticate resource
This commit is contained in:
parent
677e2755b9
commit
9f02fd4e44
|
@ -22,10 +22,7 @@ def init_jwt(app):
|
||||||
|
|
||||||
class Authenticate(AbstractResource):
|
class Authenticate(AbstractResource):
|
||||||
"""
|
"""
|
||||||
Resource for user authentication. The user provides the username and password and we \
|
A resource for user authentication
|
||||||
give them a JWT. \
|
|
||||||
See `AuthService.js` file for the frontend counterpart for this code. \
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
urls = ["/api/authenticate"]
|
urls = ["/api/authenticate"]
|
||||||
|
@ -35,13 +32,13 @@ class Authenticate(AbstractResource):
|
||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
"""
|
"""
|
||||||
Example request: \
|
Gets a username and password from the request sent from the client, authenticates, and
|
||||||
{ \
|
returns an access token
|
||||||
"username": "my_user", \
|
|
||||||
"password": "my_password" \
|
|
||||||
} \
|
|
||||||
|
|
||||||
|
:return: Access token in the response body
|
||||||
|
:raises IncorrectCredentialsError: If credentials are invalid
|
||||||
"""
|
"""
|
||||||
|
|
||||||
username, password = get_username_password_from_request(request)
|
username, password = get_username_password_from_request(request)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue