feat: impl bearer auth middleware

This commit is contained in:
2025-11-26 01:09:42 +00:00
parent 81e3f7af75
commit 389fe35a0a
9 changed files with 161 additions and 25 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/get-drexa/drexa/internal/auth"
"github.com/get-drexa/drexa/internal/database"
"github.com/get-drexa/drexa/internal/user"
"github.com/gofiber/fiber/v2"
)
@@ -24,7 +25,8 @@ func NewServer(c ServerConfig) *fiber.App {
app := fiber.New()
db := database.NewFromPostgres(c.PostgresURL)
authService := auth.NewService(db, auth.TokenConfig{
userService := user.NewService(db)
authService := auth.NewService(db, userService, auth.TokenConfig{
Issuer: c.JWTIssuer,
Audience: c.JWTAudience,
SecretKey: c.JWTSecretKey,