diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-07-26 14:04:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 06:04:01 +0000 |
commit | dcd3a631288686a95cedbd4aa9cce245e896825d (patch) | |
tree | e8c726ec07c3cb54fc092d63d2713fee409ee7b4 /routers/web/user/setting/security/openid.go | |
parent | 338d03ce2f05fcc49a577b58a6cfa6beb7996fd1 (diff) | |
download | gitea-dcd3a631288686a95cedbd4aa9cce245e896825d.tar.gz gitea-dcd3a631288686a95cedbd4aa9cce245e896825d.zip |
Move web JSON functions to web context and simplify code (#26132)
The JSONRedirect/JSONOK/JSONError functions were put into "Base" context
incorrectly, it would cause abuse.
Actually, they are for "web context" only, so, move them to the correct
place.
And by the way, use them to simplify old code: +75 -196
Diffstat (limited to 'routers/web/user/setting/security/openid.go')
-rw-r--r-- | routers/web/user/setting/security/openid.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/routers/web/user/setting/security/openid.go b/routers/web/user/setting/security/openid.go index f4133f3916..b5509f570f 100644 --- a/routers/web/user/setting/security/openid.go +++ b/routers/web/user/setting/security/openid.go @@ -112,9 +112,7 @@ func DeleteOpenID(ctx *context.Context) { log.Trace("OpenID address deleted: %s", ctx.Doer.Name) ctx.Flash.Success(ctx.Tr("settings.openid_deletion_success")) - ctx.JSON(http.StatusOK, map[string]any{ - "redirect": setting.AppSubURL + "/user/settings/security", - }) + ctx.JSONRedirect(setting.AppSubURL + "/user/settings/security") } // ToggleOpenIDVisibility response for toggle visibility of user's openid |