feat: 支持管理员自助修改密码 (#57)

This commit is contained in:
chengma
2026-08-09 16:49:28 +08:00
parent 2cbb98f09c
commit 008bb87620
12 changed files with 446 additions and 19 deletions
+10
View File
@@ -27,6 +27,16 @@ func TestSafeNext只允许本站绝对路径(t *testing.T) {
}
}
func TestPasswordReturnPath移除改密反馈参数(t *testing.T) {
got := passwordReturnPath("/pdd?q=shoe&change_password=1&password_error=bad&password_field=new_password")
if got != "/pdd?q=shoe" {
t.Fatalf("passwordReturnPath = %q,期望保留业务筛选并移除改密参数", got)
}
if got := passwordReturnPath("https://example.com"); got != "/shopee" {
t.Fatalf("外部返回地址应回退到 /shopee,实际 %q", got)
}
}
func TestAuthCookie安全属性(t *testing.T) {
gin.SetMode(gin.TestMode)
for _, test := range []struct {