diff --git a/internal/router/frontend.go b/internal/router/frontend.go index c2c968f..abe949a 100644 --- a/internal/router/frontend.go +++ b/internal/router/frontend.go @@ -39,7 +39,8 @@ func registerFrontendRoutes(cfg *Config) { // Public routes for login and registration pages e.GET("/login", func(c echo.Context) error { var buf bytes.Buffer - err := templates.Login().Render(c.Request().Context(), &buf) + sessionExpired := c.QueryParam("session") == "expired" + err := templates.Login(sessionExpired).Render(c.Request().Context(), &buf) if err != nil { return err } diff --git a/templates/login.templ b/templates/login.templ index 77fc349..62873fd 100644 --- a/templates/login.templ +++ b/templates/login.templ @@ -1,6 +1,6 @@ package templates -templ Login() { +templ Login(sessionExpired bool) {
@@ -29,7 +29,15 @@ templ Login() { - + + if sessionExpired { ++ Your session has expired. Please log in again to continue. +
+