Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
74fbd5cc
Commit
74fbd5cc
authored
Apr 03, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug with inactive user accessing OAuth
parent
399ac70b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
rest_framework/authentication.py
+5
-3
No files found.
rest_framework/authentication.py
View file @
74fbd5cc
...
...
@@ -10,7 +10,7 @@ from django.core.exceptions import ImproperlyConfigured
from
rest_framework
import
exceptions
,
HTTP_HEADER_ENCODING
from
rest_framework.compat
import
CsrfViewMiddleware
from
rest_framework.compat
import
oauth
,
oauth_provider
,
oauth_provider_store
from
rest_framework.compat
import
oauth2_provider
,
oauth2_provider_forms
from
rest_framework.compat
import
oauth2_provider
from
rest_framework.authtoken.models
import
Token
...
...
@@ -325,11 +325,13 @@ class OAuth2Authentication(BaseAuthentication):
except
oauth2_provider
.
models
.
AccessToken
.
DoesNotExist
:
raise
exceptions
.
AuthenticationFailed
(
'Invalid token'
)
if
not
token
.
user
.
is_active
:
user
=
token
.
user
if
not
user
.
is_active
:
msg
=
'User inactive or deleted:
%
s'
%
user
.
username
raise
exceptions
.
AuthenticationFailed
(
msg
)
return
(
token
.
user
,
token
)
return
(
user
,
token
)
def
authenticate_header
(
self
,
request
):
"""
...
...
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