Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Julien Palard
Jun Zhou
Kaleb Porter
Kristian Rune Larsen
Lazaros Toumanidis
Ludwig Hähne
Łukasz Skarżyński
Marcus Sonestedt
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* #1336 Fix encapsulation for Redirect URI scheme validation
* #1357 Move import of setting_changed signal from test to django core modules
* #1268 fix prompt=none redirects to login screen
* #1381 fix AttributeError in OAuth2ExtraTokenMiddleware when a custom AccessToken model is used

### Removed
* #1350 Remove support for Python 3.7 and Django 2.2
Expand Down
3 changes: 2 additions & 1 deletion oauth2_provider/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.contrib.auth import authenticate
from django.utils.cache import patch_vary_headers

from oauth2_provider.models import AccessToken
from oauth2_provider.models import get_access_token_model


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -53,6 +53,7 @@ def __call__(self, request):
authheader = request.META.get("HTTP_AUTHORIZATION", "")
if authheader.startswith("Bearer"):
tokenstring = authheader.split()[1]
AccessToken = get_access_token_model()
try:
token = AccessToken.objects.get(token=tokenstring)
request.access_token = token
Expand Down