Make modules/context.Context a context.Context (#16031)
* Make modules/context.Context a context.Context Signed-off-by: Andrew Thornton <art27@cantab.net> * Simplify context calls Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the base context for requests to the HammerContext Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -113,7 +113,7 @@ func NewUserPost(ctx *context.Context) {
|
||||
ctx.RenderWithErr(password.BuildComplexityError(ctx), tplUserNew, &form)
|
||||
return
|
||||
}
|
||||
pwned, err := password.IsPwned(ctx.Req.Context(), form.Password)
|
||||
pwned, err := password.IsPwned(ctx, form.Password)
|
||||
if pwned {
|
||||
ctx.Data["Err_Password"] = true
|
||||
errMsg := ctx.Tr("auth.password_pwned")
|
||||
@@ -256,7 +256,7 @@ func EditUserPost(ctx *context.Context) {
|
||||
ctx.RenderWithErr(password.BuildComplexityError(ctx), tplUserEdit, &form)
|
||||
return
|
||||
}
|
||||
pwned, err := password.IsPwned(ctx.Req.Context(), form.Password)
|
||||
pwned, err := password.IsPwned(ctx, form.Password)
|
||||
if pwned {
|
||||
ctx.Data["Err_Password"] = true
|
||||
errMsg := ctx.Tr("auth.password_pwned")
|
||||
|
||||
Reference in New Issue
Block a user