xtablo-source/backend/templates
Arthur Belleville 8b54ff4bec
feat(02-06): implement logout, protect GET /, and update layout with auth state
- Add LogoutHandler: deletes session row (D-06), clears cookie, redirects to /login
- Protect GET / inside RequireAuth group; remove old top-level registration
- Add POST /logout inside same RequireAuth group (D-22: POST-only logout)
- Update Layout signature to accept *auth.User; render logout form + email when authed
- Update Index template to accept *auth.User and show "Signed in as {email}"
- Update SignupPage/LoginPage to pass nil to Layout (auth pages are unauthed)
- Update IndexHandler to pull user from auth.Authed(ctx) and pass to template
- Update TestIndex_RendersHxGet -> TestIndex_UnauthRedirects (GET / now protected)
- AUTH-04 (logout) and AUTH-05 (protected /) are now closed
2026-05-14 22:40:10 +02:00
..
.gitkeep feat(01-01): create directory skeleton and per-package doc.go placeholders 2026-05-14 17:53:55 +02:00
auth_form_errors.templ feat(02-04): signup templates (full page + HTMX fragment) with render tests 2026-05-14 22:14:28 +02:00
auth_forms.go feat(02-05): login vertical slice with rate limiting 2026-05-14 22:27:54 +02:00
auth_login.templ feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
auth_signup.templ feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
auth_signup_test.go feat(02-04): signup templates (full page + HTMX fragment) with render tests 2026-05-14 22:14:28 +02:00
fragments.templ feat(01-03): templ layout/index/fragments + handlers + chi router 2026-05-14 19:25:43 +02:00
index.templ feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
layout.templ feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
layout_test.go test(02-06): add failing tests for logout, protected routes, and layout auth 2026-05-14 22:32:33 +02:00