Navbar logout as a POST form instead of a GET link
A GET logout can be triggered from any foreign page (img/link) and by link prefetchers. LogoutPath now renders <form method="post"> with a submit button styled like the former link; consumers register the route as POST only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b6a6298353
commit
d0e49b2365
4 files changed
+32
-6
No files matched your search
@@ -116,7 +116,7 @@ concurrent-edit conflict during the initial rollout) and can produce a
|
||||
force-move an existing tag again for any future change — always cut a
|
||||
new one, even for a one-line fix.
|
||||
|
||||
## PageHeader fields (current as of v0.1.9)
|
||||
## PageHeader fields (current as of v0.1.10)
|
||||
|
||||
`Title`, `AppName` (lowercase product name for `<title>`/footer — not
|
||||
`Name`, which collides with a domain type's own `Name` field once
|
||||
@@ -124,9 +124,13 @@ embedded in the same struct, as yakwui's viewmodel types do), `Lang`
|
||||
(`<html lang>`, defaults to `"en"`), `Theme` (`<html data-theme>`, see
|
||||
Theming), `Brand`, `BrandInitial`, `Subtitle`,
|
||||
`BasePath`, `NavItems`/`ActiveNav`, `Flash`/`FlashKind`, `Username`,
|
||||
`LogoutPath` (a plain GET link — for a POST-form logout or any other
|
||||
markup mismatch, render it yourself into `NavbarRightExtra` instead and
|
||||
leave `Username`/`LogoutPath` unset), `NavbarBeforeBrand` (before the
|
||||
`LogoutPath` (since v0.1.10 a `<form method="post">` with a submit
|
||||
button styled like the former link, never a GET link: a logout reachable
|
||||
by GET can be triggered from any foreign page via an `<img>`/link and by
|
||||
link prefetchers; the consumer registers the route as `POST` only and
|
||||
answers `GET` with 405 + `Allow: POST`. If the form needs a hidden CSRF
|
||||
field or other markup, render it yourself into `NavbarRightExtra` and
|
||||
leave `LogoutPath` unset), `NavbarBeforeBrand` (before the
|
||||
brand link, e.g. a mobile sidebar-toggle button),
|
||||
`NavbarLeftExtra`/`NavbarRightExtra` (the navbar's two groups),
|
||||
`ExtraHeadHTML`/`ExtraBodyHTML`, and `BodyAttrs`/`SidebarAttrs` —
|
||||
|
||||
Reference in new issue
Block a user