xtablo-source/backend/internal/web
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
..
ui test(01-02): add ui package smoke tests 2026-05-14 18:47:31 +02:00
handlers.go feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
handlers_auth.go feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
handlers_auth_test.go test(02-06): add failing tests for logout, protected routes, and layout auth 2026-05-14 22:32:33 +02:00
handlers_test.go feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
middleware.go feat(01-03): pgxpool wrapper, RequestID/slog middleware, slog handler switch 2026-05-14 19:24:16 +02:00
router.go feat(02-06): implement logout, protect GET /, and update layout with auth state 2026-05-14 22:40:10 +02:00
slog.go feat(01-03): pgxpool wrapper, RequestID/slog middleware, slog handler switch 2026-05-14 19:24:16 +02:00
testdb_test.go feat(02-04): signup handler, router wiring, and integration tests 2026-05-14 22:17:50 +02:00