aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-04 20:33:37 +0900
committernsfisis <nsfisis@gmail.com>2024-08-04 20:33:37 +0900
commit0f0324b396f3eab53606c8f770d26337dd0e291a (patch)
tree0a2afd4701535b11c81fb3908d8c241eaaeb7d21 /backend/main.go
parentd87507918f33b289ac4fc4dece8a54fa3aa34923 (diff)
downloadphperkaigi-2025-albatross-0f0324b396f3eab53606c8f770d26337dd0e291a.tar.gz
phperkaigi-2025-albatross-0f0324b396f3eab53606c8f770d26337dd0e291a.tar.zst
phperkaigi-2025-albatross-0f0324b396f3eab53606c8f770d26337dd0e291a.zip
feat: authenticate users in admin pages
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/main.go b/backend/main.go
index 2d38ee5..e2e4bbd 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -83,9 +83,11 @@ func main() {
adminGroup := e.Group("/admin")
adminHandler.RegisterHandlers(adminGroup)
- // For local dev:
- // This is never used in production because the reverse proxy sends /logout
- // to the app server.
+ // For local dev: This is never used in production because the reverse
+ // proxy sends /login and /logout to the app server.
+ e.GET("/login", func(c echo.Context) error {
+ return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/login")
+ })
e.POST("/logout", func(c echo.Context) error {
return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/logout")
})