Added a test for the case when there is no secret for the api client.

Fix codestyle
This commit is contained in:
Rebecca Law
2016-02-08 11:29:53 +00:00
parent 877a8a0411
commit 416dd00ac8
2 changed files with 20 additions and 5 deletions

View File

@@ -29,7 +29,6 @@ def requires_auth():
if api_client is None:
authentication_response("Invalid credentials", 403)
errors_resp = None
for secret in api_client['secret']:
try:
decode_jwt_token(
@@ -50,10 +49,6 @@ def requires_auth():
except TokenDecodeError:
errors_resp = authentication_response("Invalid token: signature", 403)
if errors_resp is None:
# If we got this far with out any errors then the api client has no secrets
errors_resp = authentication_response("Invalid token: api client has no secrets", 403)
return errors_resp