alist icon indicating copy to clipboard operation
alist copied to clipboard

建议修改登录时触发密码错误次数过多的判断逻辑

Open ByteTuxiaobei opened this issue 2 years ago • 4 comments

Please make sure of the following things

  • [X] I have read the documentation.
  • [X] I'm sure there are no duplicate issues or discussions.
  • [X] I'm sure this feature is not implemented.
  • [X] I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

HG39QBD Z({%J( U8P1_AP

建议修改登录时触发密码错误次数过多的判断逻辑(或者提供判断逻辑的切换选项),目前是以 IP 为标准进行统计的,但是对于学校、公司等场所很多人共用一个公网IP,这导致一人输错密码过多,整个场所都无法进行登录。

建议修改为以用户名为标准进行统计,判断一个用户名是否错误次数过多。

Suggested solution / 实现思路

位于 server\handles\auth.go 文件的 func Login(c *gin.Context) 函数中。

loginCache.Get(ip)
loginCache.Set(ip, count+1)
loginCache.Del(ip)

修改为

loginCache.Get(req.Username)
loginCache.Set(req.Username, count+1)
loginCache.Del(req.Username)

或是同时保留两种判断逻辑,后台可进行切换

Additional context / 附件

No response

ByteTuxiaobei avatar Feb 10 '23 11:02 ByteTuxiaobei

重启可以重置我记得

anwen-anyi avatar Feb 10 '23 14:02 anwen-anyi

重启可以重置我记得

我知道重启可以,但不可能每次出现都重启吧((;´д`)ゞ

ByteTuxiaobei avatar Feb 10 '23 15:02 ByteTuxiaobei

重启可以重置我记得

我知道重启可以,但不可能每次出现都重启吧((;´д`)ゞ

嗯,我理解你的意思,不过正常情况下6次才会锁定, 自己的账号密码的话按理说设置了记住密码了 不会错才对....

(题外话QAQ)如果是自己用要是觉的48小时登录时间太短 可以尝试设置更久一些

当然你提交的issue也是不错滴~~

anwen-anyi avatar Feb 10 '23 15:02 anwen-anyi

重启可以重置我记得

我知道重启可以,但不可能每次出现都重启吧((;´д`)ゞ

嗯,我理解你的意思,不过正常情况下6次才会锁定, 自己的账号密码的话按理说设置了记住密码了 不会错才对....

(题外话QAQ)如果是自己用要是觉的48小时登录时间太短 可以尝试设置更久一些

那个登录时间我倒是改了,改长了。

主要这网站不是我自己用(如果只是我或一小部分人用就算了

我其实是做的学校的网盘,现在 IP 判的话一个人输错多了整个学校都登不上了(#`-_ゝ-)

而且其实我是不在学校里的,不受IP影响,所以如果他们出现这么情况登录不上去我这边也没法及时发现

ByteTuxiaobei avatar Feb 10 '23 15:02 ByteTuxiaobei

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 26 '23 19:03 stale[bot]

This issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.

stale[bot] avatar Apr 03 '23 23:04 stale[bot]