Skip to content

Commit b687f1b

Browse files
committed
all tests pass
1 parent 15d381f commit b687f1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

oauth2_provider/views/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626

2727
log = logging.getLogger("oauth2_provider")
2828

29-
29+
# login_not_required decorator to bypass LoginRequiredMiddleware
30+
@method_decorator(login_not_required, name="dispatch")
3031
class BaseAuthorizationView(LoginRequiredMixin, OAuthLibMixin, View):
3132
"""
3233
Implements a generic endpoint to handle *Authorization Requests* as in :rfc:`4.1.1`. The view

tests/test_introspection_auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from django.utils import timezone
1212
from oauthlib.common import Request
1313

14+
from oauth2_provider.compat import login_not_required
1415
from oauth2_provider.models import get_access_token_model, get_application_model
1516
from oauth2_provider.oauth2_validators import OAuth2Validator
1617
from oauth2_provider.settings import oauth2_settings
@@ -93,7 +94,7 @@ def mocked_introspect_request_short_living_token(url, data, *args, **kwargs):
9394

9495
urlpatterns = [
9596
path("oauth2/", include("oauth2_provider.urls")),
96-
path("oauth2-test-resource/", ScopeResourceView.as_view()),
97+
path("oauth2-test-resource/", login_not_required(ScopeResourceView.as_view())),
9798
]
9899

99100

0 commit comments

Comments
 (0)