aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/web.go
diff options
context:
space:
mode:
authormscherer <mscherer@users.noreply.github.com>2021-11-26 15:55:11 +0100
committerGitHub <noreply@github.com>2021-11-26 22:55:11 +0800
commit1f0dab21169104941503747b2124cb6321259344 (patch)
tree55857513db1deea01e08b85031d5e8545b42d425 /routers/web/web.go
parentfcc11253ac34bdee98dce8a5dae74d5bf483fa6e (diff)
downloadgitea-1f0dab21169104941503747b2124cb6321259344.tar.gz
gitea-1f0dab21169104941503747b2124cb6321259344.zip
Implement Well-Known URL for password change (#17777)
* Implement Well-Known URL for password change Fixes #11804
Diffstat (limited to 'routers/web/web.go')
-rw-r--r--routers/web/web.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index ebced6942f..a642fdea5e 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -232,10 +232,16 @@ func RegisterRoutes(m *web.Route) {
// Routers.
// for health check
m.Get("/", Home)
- m.Get("/.well-known/openid-configuration", user.OIDCWellKnown)
- if setting.Federation.Enabled {
- m.Get("/.well-known/nodeinfo", NodeInfoLinks)
- }
+ m.Group("/.well-known", func() {
+ m.Get("/openid-configuration", user.OIDCWellKnown)
+ if setting.Federation.Enabled {
+ m.Get("/nodeinfo", NodeInfoLinks)
+ }
+ m.Get("/change-password", func(w http.ResponseWriter, req *http.Request) {
+ http.Redirect(w, req, "/user/settings/account", http.StatusTemporaryRedirect)
+ })
+ })
+
m.Group("/explore", func() {
m.Get("", func(ctx *context.Context) {
ctx.Redirect(setting.AppSubURL + "/explore/repos")