Skip to content

Commit 82fdef1

Browse files
committed
feat: enable captcha requirement based on max attempts configuration
1 parent d883d0f commit 82fdef1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/users/serializers/login.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def generate(username: str, type: str = 'system'):
143143
auth_setting = LoginSerializer.get_auth_setting()
144144
max_attempts = auth_setting.get("max_attempts", 1)
145145

146-
need_captcha = False
146+
need_captcha = True
147147
if max_attempts == -1:
148148
need_captcha = False
149149
elif max_attempts > 0:
@@ -164,7 +164,7 @@ def chat_generate(username: str, type: str = 'chat', access_token: str = ''):
164164
auth_setting = application_access_token.authentication_value
165165
max_attempts = auth_setting.get("max_attempts", 1)
166166

167-
need_captcha = False
167+
need_captcha = True
168168
if max_attempts == -1:
169169
need_captcha = False
170170
elif max_attempts > 0:

0 commit comments

Comments
 (0)