feat: support for authorize post in oidc controller

This commit is contained in:
Stavros
2026-04-27 20:13:14 +03:00
parent 5d95123dcb
commit 74901dd88f
6 changed files with 74 additions and 13 deletions
+7
View File
@@ -39,6 +39,7 @@ func (m *UIMiddleware) Init() error {
func (m *UIMiddleware) Middleware() gin.HandlerFunc {
return func(c *gin.Context) {
path := strings.TrimPrefix(c.Request.URL.Path, "/")
method := c.Request.Method
tlog.App.Debug().Str("path", path).Msg("path")
@@ -52,6 +53,12 @@ func (m *UIMiddleware) Middleware() gin.HandlerFunc {
c.Writer.Write([]byte("User-agent: *\nDisallow: /\n"))
return
default:
// For OIDC post authentication, we need to redirect the POST to /authorize to the backend
if method == http.MethodPost && strings.HasPrefix(path, "authorize") {
c.Next()
return
}
_, err := fs.Stat(m.uiFs, path)
// Enough for one authentication flow