Add authorization check.

This commit is contained in:
Alexis Lahouze 2017-05-25 22:11:42 +02:00
parent e921dbeb5f
commit 554a531f57
1 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,9 @@ class LoginResource(Resource):
def post(self):
"""Login to retrieve authentication token."""
if not request.authorization:
ns.abort(401, "Missing authorization.")
email = request.authorization['username']
password = request.authorization['password']