aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/setting/oauth2.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user/setting/oauth2.go')
-rw-r--r--routers/user/setting/oauth2.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/routers/user/setting/oauth2.go b/routers/user/setting/oauth2.go
index 7f0f8db1c8..a12f4dc1ba 100644
--- a/routers/user/setting/oauth2.go
+++ b/routers/user/setting/oauth2.go
@@ -6,6 +6,7 @@ package setting
import (
"fmt"
+ "net/http"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
@@ -29,7 +30,7 @@ func OAuthApplicationsPost(ctx *context.Context) {
if ctx.HasError() {
loadApplicationsData(ctx)
- ctx.HTML(200, tplSettingsApplications)
+ ctx.HTML(http.StatusOK, tplSettingsApplications)
return
}
// TODO validate redirect URI
@@ -49,7 +50,7 @@ func OAuthApplicationsPost(ctx *context.Context) {
ctx.ServerError("GenerateClientSecret", err)
return
}
- ctx.HTML(200, tplSettingsOAuthApplications)
+ ctx.HTML(http.StatusOK, tplSettingsOAuthApplications)
}
// OAuthApplicationsEdit response for editing oauth2 application
@@ -61,7 +62,7 @@ func OAuthApplicationsEdit(ctx *context.Context) {
if ctx.HasError() {
loadApplicationsData(ctx)
- ctx.HTML(200, tplSettingsApplications)
+ ctx.HTML(http.StatusOK, tplSettingsApplications)
return
}
// TODO validate redirect URI
@@ -76,7 +77,7 @@ func OAuthApplicationsEdit(ctx *context.Context) {
return
}
ctx.Flash.Success(ctx.Tr("settings.update_oauth2_application_success"))
- ctx.HTML(200, tplSettingsOAuthApplications)
+ ctx.HTML(http.StatusOK, tplSettingsOAuthApplications)
}
// OAuthApplicationsRegenerateSecret handles the post request for regenerating the secret
@@ -104,7 +105,7 @@ func OAuthApplicationsRegenerateSecret(ctx *context.Context) {
return
}
ctx.Flash.Success(ctx.Tr("settings.update_oauth2_application_success"))
- ctx.HTML(200, tplSettingsOAuthApplications)
+ ctx.HTML(http.StatusOK, tplSettingsOAuthApplications)
}
// OAuth2ApplicationShow displays the given application
@@ -123,7 +124,7 @@ func OAuth2ApplicationShow(ctx *context.Context) {
return
}
ctx.Data["App"] = app
- ctx.HTML(200, tplSettingsOAuthApplications)
+ ctx.HTML(http.StatusOK, tplSettingsOAuthApplications)
}
// DeleteOAuth2Application deletes the given oauth2 application
@@ -135,7 +136,7 @@ func DeleteOAuth2Application(ctx *context.Context) {
log.Trace("OAuth2 Application deleted: %s", ctx.User.Name)
ctx.Flash.Success(ctx.Tr("settings.remove_oauth2_application_success"))
- ctx.JSON(200, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]interface{}{
"redirect": setting.AppSubURL + "/user/settings/applications",
})
}
@@ -152,7 +153,7 @@ func RevokeOAuth2Grant(ctx *context.Context) {
}
ctx.Flash.Success(ctx.Tr("settings.revoke_oauth2_grant_success"))
- ctx.JSON(200, map[string]interface{}{
+ ctx.JSON(http.StatusOK, map[string]interface{}{
"redirect": setting.AppSubURL + "/user/settings/applications",
})
}