feat: enable captcha requirement based on max attempts configuration
parent
d883d0fa3e
commit
82fdef16f1
|
|
@ -143,7 +143,7 @@ class CaptchaSerializer(serializers.Serializer):
|
||||||
auth_setting = LoginSerializer.get_auth_setting()
|
auth_setting = LoginSerializer.get_auth_setting()
|
||||||
max_attempts = auth_setting.get("max_attempts", 1)
|
max_attempts = auth_setting.get("max_attempts", 1)
|
||||||
|
|
||||||
need_captcha = False
|
need_captcha = True
|
||||||
if max_attempts == -1:
|
if max_attempts == -1:
|
||||||
need_captcha = False
|
need_captcha = False
|
||||||
elif max_attempts > 0:
|
elif max_attempts > 0:
|
||||||
|
|
@ -164,7 +164,7 @@ class CaptchaSerializer(serializers.Serializer):
|
||||||
auth_setting = application_access_token.authentication_value
|
auth_setting = application_access_token.authentication_value
|
||||||
max_attempts = auth_setting.get("max_attempts", 1)
|
max_attempts = auth_setting.get("max_attempts", 1)
|
||||||
|
|
||||||
need_captcha = False
|
need_captcha = True
|
||||||
if max_attempts == -1:
|
if max_attempts == -1:
|
||||||
need_captcha = False
|
need_captcha = False
|
||||||
elif max_attempts > 0:
|
elif max_attempts > 0:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue