This commit is contained in:
2026-03-05 10:33:04 +08:00
parent 30c91cf5c8
commit fa1d1623c3
3 changed files with 3 additions and 143 deletions
+3 -5
View File
@@ -15,11 +15,9 @@ func SetupRoutes(router *mux.Router, db *sql.DB) {
router.HandleFunc("/ready", handlers.ReadyHandler).Methods("GET")
authRoutes := router.PathPrefix("/v1/auth").Subrouter()
frontendOnly := authRoutes.NewRoute().Subrouter()
frontendOnly.Use(middleware.FrontendOriginWhitelist)
frontendOnly.HandleFunc("/login", handlers.GoogleLogin).Methods("GET")
frontendOnly.HandleFunc("/forgot-password", handlers.ForgotPassword).Methods("GET")
frontendOnly.HandleFunc("/callback", handlers.GoogleCallback).Methods("GET")
authRoutes.HandleFunc("/login", handlers.GoogleLogin).Methods("GET")
authRoutes.HandleFunc("/forgot-password", handlers.ForgotPassword).Methods("GET")
authRoutes.HandleFunc("/callback", handlers.GoogleCallback).Methods("GET")
csrfProtected := authRoutes.NewRoute().Subrouter()
csrfProtected.Use(middleware.CSRFMiddleware)