Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iric-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bioinfo_iric
iric-data
Commits
9c93d8e8
Commit
9c93d8e8
authored
3 years ago
by
Jean-Philippe Laverdure
Browse files
Options
Downloads
Patches
Plain Diff
small fix to allow fallback in case of missing headers
parent
471bbdc1
No related branches found
Branches containing commit
No related tags found
1 merge request
!77
Resolve "Explore GraphQL as separate API"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
portal/auth_backends.py
+5
-5
5 additions, 5 deletions
portal/auth_backends.py
with
5 additions
and
5 deletions
portal/auth_backends.py
+
5
−
5
View file @
9c93d8e8
...
...
@@ -4,9 +4,9 @@ from django.contrib.auth.models import User
class
TokenAuthBackend
(
ModelBackend
):
def
authenticate
(
self
,
request
,
token
=
None
):
if
not
token
:
if
not
token
and
'
headers
'
in
request
:
token
=
request
.
headers
.
get
(
'
Iric-Auth-Token
'
)
try
:
return
User
.
objects
.
get
(
profile__api_token
=
token
)
except
User
.
DoesNotExist
:
return
None
try
:
return
User
.
objects
.
get
(
profile__api_token
=
token
)
except
User
.
DoesNotExist
:
return
None
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment