Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
7fb868df
Commit
7fb868df
authored
Jun 20, 2018
by
BAIRE Anthony
Browse files
fix error 500 when runner token is invalid
parent
96e19513
Changes
1
Hide whitespace changes
Inline
Side-by-side
django/jwt/views.py
View file @
7fb868df
...
...
@@ -141,9 +141,12 @@ def jwt_auth(request):
return
HttpResponse
(
status
=
401
)
username
,
password
=
base64
.
b64decode
(
credentials
).
decode
(
'utf-8'
).
split
(
':'
,
1
)
#log.debug('HTTP_AUTHORIZATION %s username %s', auth_header, username)
if
username
==
"$token"
and
Runner
.
objects
.
get
(
token
=
password
):
log
.
info
(
"Token for runner called"
)
actor
=
Runner
.
objects
.
get
(
token
=
password
)
if
username
==
"$token"
:
try
:
actor
=
Runner
.
objects
.
get
(
token
=
password
)
log
.
info
(
"Token for runner called"
)
except
Runner
.
DoesNotExist
:
return
HttpResponse
(
status
=
401
)
else
:
try
:
actor
=
User
.
objects
.
get
(
email
=
username
)
...
...
Write
Preview
Markdown
is supported
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