Publish current project state
This commit is contained in:
@@ -19,17 +19,17 @@ import (
|
||||
"github.com/gochat/gochat/internal/config"
|
||||
"github.com/gochat/gochat/internal/middleware"
|
||||
"github.com/gochat/gochat/internal/model"
|
||||
"github.com/gochat/gochat/pkg/response"
|
||||
applogger "github.com/gochat/gochat/pkg/logger"
|
||||
"github.com/gochat/gochat/pkg/response"
|
||||
)
|
||||
|
||||
// OIDCHandler handles OIDC/OAuth2 enterprise authentication HTTP endpoints.
|
||||
type OIDCHandler struct {
|
||||
oidcService *auth.OIDCService
|
||||
ssoMiddleware *auth.SSOMiddleware
|
||||
jwtService *auth.JWTService
|
||||
refreshStore *auth.RefreshTokenStore
|
||||
oidcCfg *config.OIDCConfig
|
||||
oidcService *auth.OIDCService
|
||||
ssoMiddleware *auth.SSOMiddleware
|
||||
jwtService *auth.JWTService
|
||||
refreshStore *auth.RefreshTokenStore
|
||||
oidcCfg *config.OIDCConfig
|
||||
}
|
||||
|
||||
// NewOIDCHandler creates an OIDC handler with service dependencies.
|
||||
@@ -240,12 +240,12 @@ func (h *OIDCHandler) Callback(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, response.APIResponse{
|
||||
Success: true,
|
||||
Data: gin.H{
|
||||
"access_token": accessToken,
|
||||
"user_id": result.UserID,
|
||||
"account_id": result.AccountID,
|
||||
"role": result.Role,
|
||||
"provider": string(result.Provider),
|
||||
"session_id": sessionID,
|
||||
"access_token": accessToken,
|
||||
"user_id": result.UserID,
|
||||
"account_id": result.AccountID,
|
||||
"role": result.Role,
|
||||
"provider": string(result.Provider),
|
||||
"session_id": sessionID,
|
||||
"auto_provisioned": result.AutoProvision,
|
||||
},
|
||||
})
|
||||
@@ -531,10 +531,10 @@ func RegisterOIDCRoutes(rg *gin.RouterGroup, handler *OIDCHandler, authMiddlewar
|
||||
|
||||
// Admin-only config management routes (require auth + administrator role)
|
||||
configGroup := oidcGroup.Group("/config")
|
||||
configGroup.Use(authMiddleware, middleware.RoleCheck("administrator"))
|
||||
configGroup.Use(authMiddleware, middleware.RoleCheck(auth.RoleAdministrator))
|
||||
{
|
||||
configGroup.GET("", handler.GetConfig)
|
||||
configGroup.PUT("", handler.UpdateConfig)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user