feat: 支持管理员自助修改密码 (#57)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user