v2: fixed oauth errors, oauth clients native control added
This commit is contained in:
@@ -35,8 +35,6 @@ func main() {
|
||||
|
||||
userRepo := repositories.NewUserRepository(postgres.Pool)
|
||||
oauthRepo := repositories.NewOAuthRepository(postgres.Pool)
|
||||
positionRepo := repositories.NewPositionRepository(postgres.Pool)
|
||||
citizenshipRepo := repositories.NewCitizenshipRepository(postgres.Pool)
|
||||
|
||||
if err := seedClient(context.Background(), oauthRepo, cfg.Client); err != nil {
|
||||
log.Fatalf("seed client: %v", err)
|
||||
@@ -45,11 +43,10 @@ func main() {
|
||||
svc := services.New(
|
||||
userRepo,
|
||||
oauthRepo,
|
||||
positionRepo,
|
||||
redis.Client,
|
||||
services.TokenConfig{
|
||||
AccessTTL: cfg.JWT.TTL,
|
||||
RefreshTTL: cfg.JWT.TTL * 7,
|
||||
AccessTTL: cfg.Tokens.AccessTTL,
|
||||
RefreshTTL: cfg.Tokens.RefreshTTL,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -58,11 +55,9 @@ func main() {
|
||||
authHandler := handlers.NewAuthHandler(svc)
|
||||
oauthHandler := handlers.NewOAuthHandler(svc, cfg.Server.FrontendURL)
|
||||
consentHandler := handlers.NewConsentHandler(svc)
|
||||
positionsHandler := handlers.NewPositionsHandler(svc)
|
||||
citizenshipSvc := services.NewCitizenshipService(citizenshipRepo)
|
||||
citizenshipHandler := handlers.NewCitizenshipHandler(citizenshipSvc)
|
||||
clientHandler := handlers.NewClientHandler(svc)
|
||||
|
||||
router := http.NewRouter(authHandler, oauthHandler, consentHandler, positionsHandler, citizenshipHandler, svc, oauthRepo, limiter)
|
||||
router := http.NewRouter(authHandler, oauthHandler, consentHandler, clientHandler, svc, oauthRepo, limiter)
|
||||
|
||||
log.Printf("starting server on %s", cfg.Server.Addr)
|
||||
if err := router.Run(cfg.Server.Addr); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user