Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OSUG
RESIF
ws-eidaauth
Commits
e4510718
Commit
e4510718
authored
Jul 10, 2020
by
Jonathan Schaeffer
Browse files
Change http status code for expired token
parent
fce757af
Changes
1
Hide whitespace changes
Inline
Side-by-side
eidawsauth/eidawsauth.py
View file @
e4510718
...
...
@@ -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
=
4
15
)
return
Response
(
'Token is expired. Please generate a new one at https://geofon.gfz-potsdam.de/eas/'
,
status
=
4
00
)
logging
.
info
(
"Token is valid"
)
# Compute a random login and password
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment