package routes

import (
	"history-api/internal/controllers"
	"history-api/internal/middlewares"
	"history-api/internal/repositories"

	"github.com/gofiber/fiber/v3"
)

func AuthRoutes(app *fiber.App, controller *controllers.AuthController, userRepo repositories.UserRepository) {
	route := app.Group("/auth")
	route.Post("/signin", controller.Signin)
	route.Post("/signup", controller.Signup)
	route.Post("/refresh", middlewares.JwtRefresh(), controller.RefreshToken)
	route.Post("/token/create", controller.CreateToken)
	route.Post("/token/verify", controller.VerifyToken)
	route.Post("/forgot-password", controller.ForgotPassword)
	route.Get("/google/login", controller.GoogleLogin)
	route.Get("/google/callback", controller.GoogleCallback)
	route.Post("/logout", middlewares.JwtAccess(userRepo), controller.Logout)
}
