Skip to content

Commit cf91734

Browse files
committed
refactor: adjust max_attempts default and captcha requirement in authentication logic
1 parent 0969f70 commit cf91734

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
@@ -76,12 +76,12 @@ def login(instance):
7676
except Exception:
7777
auth_setting = {}
7878

79-
max_attempts = auth_setting.get("max_attempts", 0)
79+
max_attempts = auth_setting.get("max_attempts", 1)
8080
password = instance.get("password")
8181
captcha = instance.get("captcha", "")
8282

8383
# 判断是否需要验证码
84-
need_captcha = True
84+
need_captcha = False
8585
if max_attempts == -1:
8686
need_captcha = False
8787
elif max_attempts > 0:

0 commit comments

Comments
 (0)