我使用 django-rest-framework-simplejwt 进行身份验证。在每个请求中,如果某个变量有效,我需要检查令牌(如果 create_time < last change password 我将拒绝连接)。在 django 中最好的方法是什么?
我认为最好的解决方案是创建带有验证的新类,但我不知道它应该包括什么?我有3个候选人
'USER_AUTHENTICATION_RULE': 'rest_framework_simplejwt.authentication.default_user_authentication_rule',
'AUTH_TOKEN_CLASSES': ('rest_framework_simplejwt.tokens.AccessToken',),
'DEFAULT_AUTHENTICATION_CLASSES':('rest_framework_simplejwt.authentication.JWTAuthentication',)