feat: added web based auth path
Go CI / build (push) Successful in 46s

This commit is contained in:
2025-09-20 00:29:41 -07:00
parent a95f355059
commit 55d4eb2e26
6 changed files with 432 additions and 31 deletions
+8 -1
View File
@@ -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)