aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/user/setting/applications.go
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-09-15 08:13:19 +0200
committerGitHub <noreply@github.com>2023-09-15 06:13:19 +0000
commitc548dde205244a39a26ba98377c0f5cc11da7041 (patch)
treef9d9e1185609703e320ed07fd2ff3f95dbdcc230 /routers/web/user/setting/applications.go
parentf8a109440655b77e8554e1744e31bf52a7c63df7 (diff)
downloadgitea-c548dde205244a39a26ba98377c0f5cc11da7041.tar.gz
gitea-c548dde205244a39a26ba98377c0f5cc11da7041.zip
More refactoring of `db.DefaultContext` (#27083)
Next step of #27065
Diffstat (limited to 'routers/web/user/setting/applications.go')
-rw-r--r--routers/web/user/setting/applications.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/web/user/setting/applications.go b/routers/web/user/setting/applications.go
index 088aba38b6..ee44d48dce 100644
--- a/routers/web/user/setting/applications.go
+++ b/routers/web/user/setting/applications.go
@@ -53,7 +53,7 @@ func ApplicationsPost(ctx *context.Context) {
Scope: scope,
}
- exist, err := auth_model.AccessTokenByNameExists(t)
+ exist, err := auth_model.AccessTokenByNameExists(ctx, t)
if err != nil {
ctx.ServerError("AccessTokenByNameExists", err)
return
@@ -64,7 +64,7 @@ func ApplicationsPost(ctx *context.Context) {
return
}
- if err := auth_model.NewAccessToken(t); err != nil {
+ if err := auth_model.NewAccessToken(ctx, t); err != nil {
ctx.ServerError("NewAccessToken", err)
return
}
@@ -77,7 +77,7 @@ func ApplicationsPost(ctx *context.Context) {
// DeleteApplication response for delete user access token
func DeleteApplication(ctx *context.Context) {
- if err := auth_model.DeleteAccessTokenByID(ctx.FormInt64("id"), ctx.Doer.ID); err != nil {
+ if err := auth_model.DeleteAccessTokenByID(ctx, ctx.FormInt64("id"), ctx.Doer.ID); err != nil {
ctx.Flash.Error("DeleteAccessTokenByID: " + err.Error())
} else {
ctx.Flash.Success(ctx.Tr("settings.delete_token_success"))
@@ -88,7 +88,7 @@ func DeleteApplication(ctx *context.Context) {
func loadApplicationsData(ctx *context.Context) {
ctx.Data["AccessTokenScopePublicOnly"] = auth_model.AccessTokenScopePublicOnly
- tokens, err := auth_model.ListAccessTokens(auth_model.ListAccessTokensOptions{UserID: ctx.Doer.ID})
+ tokens, err := auth_model.ListAccessTokens(ctx, auth_model.ListAccessTokensOptions{UserID: ctx.Doer.ID})
if err != nil {
ctx.ServerError("ListAccessTokens", err)
return