mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-08-31 08:57:14 +02:00
Merge branch 'feat/74-assign-user-role-based-on-ldap-group' into metric-store-tickets
This commit is contained in:
@@ -189,7 +189,14 @@ func (s *Server) init() error {
|
||||
|
||||
if auth.Keys.OpenIDConfig != nil {
|
||||
openIDConnect := auth.NewOIDC(authHandle)
|
||||
openIDConnect.RegisterEndpoints(s.router)
|
||||
// The OIDC callback mutates the session (SaveSession renews the token and
|
||||
// writes the session data), so these routes have to run inside
|
||||
// scs.LoadAndSave just like /login and /logout. Without it the session
|
||||
// is missing from the request context and scs panics.
|
||||
s.router.Group(func(r chi.Router) {
|
||||
r.Use(sessionManager.LoadAndSave)
|
||||
openIDConnect.RegisterEndpoints(r)
|
||||
})
|
||||
info["hasOpenIDConnect"] = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user