Skip to content

Commit a5c3073

Browse files
committed
Update decorator
1 parent 7776294 commit a5c3073

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

caching/private_api/decorators.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from rest_framework.response import Response
66

77
from caching.private_api.management import CacheManagement, CacheMissError
8+
from metrics.api.django_cognito_jwt import backend
89

910

1011
class CacheCheckResultedInMissError(Exception): ...
@@ -72,10 +73,8 @@ def wrapped_view(*args, **kwargs) -> Response:
7273

7374

7475
def _check_if_valid_non_public_request(request):
75-
try:
76-
is_authenticated = request.auth()
77-
except TypeError:
78-
is_authenticated = False
76+
auth = backend.JSONWebTokenAuthentication()
77+
is_authenticated = auth.authenticate(request)
7978

8079
return is_authenticated
8180

0 commit comments

Comments
 (0)