+8
-1
@@ -54,8 +54,15 @@ func main() {
|
||||
if err != nil {
|
||||
zap.S().Fatalf("Failed to initialize authenticator: %v", err)
|
||||
}
|
||||
authHandler := &api.AuthHandler{Store: s, Authenticator: authenticator}
|
||||
// Get Frontend URL from environment
|
||||
frontendURL := os.Getenv("FRONTEND_URL")
|
||||
if frontendURL == "" {
|
||||
frontendURL = "http://localhost:5173"
|
||||
}
|
||||
authHandler := &api.AuthHandler{Store: s, Authenticator: authenticator, FrontendURL: frontendURL}
|
||||
|
||||
router.GET("/api/auth/google/login", authHandler.HandleGoogleLogin)
|
||||
router.GET("/api/auth/google/callback", authHandler.HandleGoogleCallback)
|
||||
router.GET("/api/auth/google/cli/login", authHandler.HandleCliLogin)
|
||||
router.POST("/api/auth/google/cli/callback", authHandler.HandleCliCallback)
|
||||
router.GET("/api/auth/user", api.AuthMiddleware(s), authHandler.HandleGetUser)
|
||||
|
||||
Reference in New Issue
Block a user