File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1+ from django .conf import settings
12from django .contrib .auth import authenticate , get_user_model
23from django .contrib .auth .models import update_last_login
34from django .utils .translation import gettext_lazy as _
@@ -147,7 +148,10 @@ class TokenVerifySerializer(serializers.Serializer):
147148 def validate (self , attrs ):
148149 token = UntypedToken (attrs ['token' ])
149150
150- if api_settings .BLACKLIST_AFTER_ROTATION :
151+ if (
152+ api_settings .BLACKLIST_AFTER_ROTATION
153+ and 'rest_framework_simplejwt.token_blacklist' in settings .INSTALLED_APPS
154+ ):
151155 jti = token .get (api_settings .JTI_CLAIM )
152156 if BlacklistedToken .objects .filter (token__jti = jti ).exists ():
153157 raise ValidationError ("Token is blacklisted" )
You can’t perform that action at this time.
0 commit comments