mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-01-27 01:32:32 +00:00
feat: implement basic oidc functionality
This commit is contained in:
@@ -176,7 +176,7 @@ func (app *BootstrapApp) Setup() error {
|
||||
app.context.configuredProviders = configuredProviders
|
||||
|
||||
// Setup router
|
||||
router, err := app.setupRouter()
|
||||
router, err := app.setupRouter(queries)
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to setup routes: %w", err)
|
||||
|
||||
@@ -7,13 +7,14 @@ import (
|
||||
"github.com/steveiliop56/tinyauth/internal/config"
|
||||
"github.com/steveiliop56/tinyauth/internal/controller"
|
||||
"github.com/steveiliop56/tinyauth/internal/middleware"
|
||||
"github.com/steveiliop56/tinyauth/internal/repository"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var DEV_MODES = []string{"main", "test", "development"}
|
||||
|
||||
func (app *BootstrapApp) setupRouter() (*gin.Engine, error) {
|
||||
func (app *BootstrapApp) setupRouter(queries *repository.Queries) (*gin.Engine, error) {
|
||||
if !slices.Contains(DEV_MODES, config.Version) {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
}
|
||||
@@ -88,7 +89,8 @@ func (app *BootstrapApp) setupRouter() (*gin.Engine, error) {
|
||||
|
||||
oidcController := controller.NewOIDCController(controller.OIDCControllerConfig{
|
||||
Clients: app.context.oidcClients,
|
||||
}, apiRouter)
|
||||
AppURL: app.config.AppURL,
|
||||
}, apiRouter, queries)
|
||||
|
||||
oidcController.SetupRoutes()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user