Files
Authentication/routes/routes.go
T
2025-11-25 15:12:31 +08:00

23 lines
822 B
Go

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)
}