return cache_key in jwt

This commit is contained in:
2025-05-05 08:38:05 +03:30
parent 6648dc8de7
commit 83a052539b

View File

@@ -20,7 +20,7 @@ class CustomizedTokenObtainPairSerializer(TokenObtainPairSerializer): # noqa
captcha_code = self.context['request'].data['captcha_code']
captcha_key = self.context['request'].data['captcha_key']
return {"cache_key": cache.get(captcha_key)}
if captcha_code != cache.get(captcha_key) or captcha_code not in self.context['request'].data.keys():
raise captcha_exception.CaptchaFailed()