1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 18:58:38 +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

@@ -53,7 +53,7 @@ func TwoFactorPost(ctx *context.Context) {
}
id := idSess.(int64)
twofa, err := auth.GetTwoFactorByUID(id)
twofa, err := auth.GetTwoFactorByUID(ctx, id)
if err != nil {
ctx.ServerError("UserSignIn", err)
return
@@ -83,7 +83,7 @@ func TwoFactorPost(ctx *context.Context) {
}
twofa.LastUsedPasscode = form.Passcode
if err = auth.UpdateTwoFactor(twofa); err != nil {
if err = auth.UpdateTwoFactor(ctx, twofa); err != nil {
ctx.ServerError("UserSignIn", err)
return
}
@@ -126,7 +126,7 @@ func TwoFactorScratchPost(ctx *context.Context) {
}
id := idSess.(int64)
twofa, err := auth.GetTwoFactorByUID(id)
twofa, err := auth.GetTwoFactorByUID(ctx, id)
if err != nil {
ctx.ServerError("UserSignIn", err)
return
@@ -140,7 +140,7 @@ func TwoFactorScratchPost(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
}