package routes

import (
	"authentication/handlers"
	"database/sql"

	"github.com/gorilla/mux"
	httpSwagger "github.com/swaggo/http-swagger"
)

func SetupRoutes(router *mux.Router, db *sql.DB) {
	authRoutes := router.PathPrefix("/v1/auth").Subrouter()
	authRoutes.HandleFunc("/login", handlers.GoogleLogin).Methods("GET")
	authRoutes.HandleFunc("/callback", handlers.GoogleCallback).Methods("GET")
	authRoutes.HandleFunc("/refresh_token", handlers.HandleTokenRefresh).Methods("GET", "POST", "OPTIONS")
	authRoutes.HandleFunc("/logout", handlers.LogoutHandler).Methods("GET")

	// authRoutes.HandleFunc("/microsoft/login", handlers.MicrosoftLogin).Methods("GET")
	// authRoutes.HandleFunc("/microsoft/callback", handlers.MicrosoftCallback).Methods("GET")

	router.PathPrefix("/swagger/").Handler(httpSwagger.WrapHandler)
}
