Commit e4510718 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer

Change http status code for expired token

parent fce757af
......@@ -205,7 +205,7 @@ def auth():
expiration_ts= datetime.datetime.strptime(tokendict['valid_until'], '%Y-%m-%dT%H:%M:%S.%fZ')
if (expiration_ts - datetime.datetime.now()).total_seconds() < 0:
logging.info("Token is expired")
return Response('Token is expired. Please generate a new one at https://geofon.gfz-potsdam.de/eas/', status=415)
return Response('Token is expired. Please generate a new one at https://geofon.gfz-potsdam.de/eas/', status=400)
logging.info("Token is valid")
# Compute a random login and password
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment