1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

More refactoring of db.DefaultContext (#27083)

Next step of #27065
This commit is contained in:
JakobDev
2023-09-15 08:13:19 +02:00
committed by GitHub
parent f8a1094406
commit c548dde205
83 changed files with 336 additions and 320 deletions

View File

@@ -120,7 +120,7 @@ func commonResetPassword(ctx *context.Context) (*user_model.User, *auth.TwoFacto
return nil, nil
}
twofa, err := auth.GetTwoFactorByUID(u.ID)
twofa, err := auth.GetTwoFactorByUID(ctx, u.ID)
if err != nil {
if !auth.IsErrTwoFactorNotEnrolled(err) {
ctx.Error(http.StatusInternalServerError, "CommonResetPassword", err.Error())
@@ -217,7 +217,7 @@ func ResetPasswdPost(ctx *context.Context) {
}
twofa.LastUsedPasscode = passcode
if err = auth.UpdateTwoFactor(twofa); err != nil {
if err = auth.UpdateTwoFactor(ctx, twofa); err != nil {
ctx.ServerError("ResetPasswdPost: UpdateTwoFactor", err)
return
}
@@ -249,7 +249,7 @@ func ResetPasswdPost(ctx *context.Context) {
ctx.ServerError("UserSignIn", err)
return
}
if err = auth.UpdateTwoFactor(twofa); err != nil {
if err = auth.UpdateTwoFactor(ctx, twofa); err != nil {
ctx.ServerError("UserSignIn", err)
return
}