Skip to content

fix: portal auth setting - #7819

Merged
fit2cloudwxx merged 1 commit into
v3from
pr@v3@fix_portalAuthSetting
Nov 10, 2026
Merged

fit2cloudwxx merged 1 commit into
v3from
pr@v3@fix_portalAuthSetting

Conversation

@shaohuzhang1

@shaohuzhang1 shaohuzhang1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

【【门户访问设置】登录设置的登录失败N次锁定账号,N无法设置为 -1】
https://www.tapd.cn/tapd_fe/45245355/bug/detail/1145245355001079125

<el-input-number v-model="authForm.failed_attempts" class="w-32!" :min="-1" :max="100" :precision="0" :value-on-clear="5" />
<span class="shrink-0">次,锁定账号</span>
<el-input-number v-model="authForm.lock_time" class="w-32!" :min="1" :max="1440" :precision="0" :value-on-clear="10" />
<span class="shrink-0">分钟</span>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a concise review of the code change:

Issue: Logical/Security Flaw

  • min="-1" allows negative values: failed_attempts represents a count of failures. Allowing -1 (or any negative number) is meaningless and logically incorrect for this field. It could lead to unexpected behavior in backend logic (e.g., if the system checks attempts >= threshold, a negative value might bypass lockouts incorrectly or cause calculation errors).

Recommendation:

  • Revert to :min="0" (or 1 if zero failures shouldn't be stored). Negative values are not valid for a "failure counter."
  • If the intent was to allow clearing/resetting via the UI, use value-on-clear appropriately, but keep min non-negative.

Additional Suggestion:

  • Ensure the UI text ("Login failed... times") clearly indicates that this is a threshold for locking account, not the current attempt count. If it's the threshold, min="1" is safer because locking after 0 failures makes no sense.

@fit2cloudwxx
fit2cloudwxx merged commit e0107da into v3 Nov 10, 2026
3 of 4 checks passed
@fit2cloudwxx
fit2cloudwxx deleted the pr@v3@fix_portalAuthSetting branch November 10, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants