Skip to content

Commit 13c15f4

Browse files
committed
handle well-known routes by server-side
1 parent 68c2454 commit 13c15f4

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dev/Caddyfile

+1-5
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ root * /usr/share/caddy
1010
handle /api/* {
1111
reverse_proxy backend:3000
1212
}
13-
1413
handle /.well-known/* {
15-
respond 404
16-
}
17-
handle /.well-known/change-password {
18-
redir * /settings/session
14+
reverse_proxy backend:3000
1915
}
2016

2117
handle {

router/router.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ type Router struct {
3434
func Setup(hub *hub.Hub, db *gorm.DB, repo repository.Repository, ss *service.Services, logger *zap.Logger, config *Config) *echo.Echo {
3535
r := newRouter(hub, db, repo, ss, logger.Named("router"), config)
3636

37-
r.e.GET("/.well-known/openid-configuration", func(c echo.Context) error {
38-
return c.Redirect(http.StatusFound, "/api/v3/oauth2/oidc/discovery")
39-
})
37+
wellKnown := r.e.Group("/.well-known")
38+
{
39+
wellKnown.GET("/reset-password", func(c echo.Context) error {
40+
return c.Redirect(http.StatusFound, "/settings/session")
41+
})
42+
wellKnown.GET("/openid-configuration", func(c echo.Context) error {
43+
return c.Redirect(http.StatusFound, "/api/v3/oauth2/oidc/discovery")
44+
})
45+
}
4046

4147
api := r.e.Group("/api")
4248
api.GET("/metrics", echoprometheus.NewHandler())

0 commit comments

Comments
 (0)