fix captcha wrong in jwt confitions

This commit is contained in:
2025-05-05 08:46:20 +03:30
parent 83a052539b
commit 9d63a7d531
2 changed files with 3 additions and 5 deletions

View File

@@ -20,8 +20,8 @@ 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():
if captcha_code != cache.get(captcha_key) or 'captcha_code' not in self.context['request'].data.keys():
raise captcha_exception.CaptchaFailed()
data = super().validate(attrs)