add auth to backend and frontend

This commit is contained in:
2026-02-24 10:42:36 -05:00
parent 11eb192e2a
commit 0d5cc4d21f
14 changed files with 336 additions and 35 deletions
+6
View File
@@ -76,10 +76,16 @@ func main() {
// Register routes
http.HandleFunc("/login", userHandler.Login)
http.HandleFunc("/logout", userHandler.Logout)
http.Handle("/weather/fetch", middleware.AuthMiddleware(authService)(
http.HandlerFunc(weatherHandler.FetchWeather)),
)
http.Handle("/weather/me", middleware.AuthMiddleware(authService)(
http.HandlerFunc(userHandler.Me)),
)
http.HandleFunc("/weather/history", weatherHandler.GetHistory)
http.HandleFunc("/health", handlers.Health)
http.HandleFunc("/latest-temperature", handlers.LatestTemperature)