Give the menu the new token after a password change
The profile page rendered after a password change carries the CSRF token set on that same response, but the menu's sign-out form was left without one — and it is the first form on the page. The e2e test that signs in, changes the password and uses the next form caught it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c9cd25efc2
commit
5e1494f76d
1 file changed
+3
@@ -524,6 +524,9 @@ func (p *AccountPages) renderWithCSRF(w http.ResponseWriter, r *http.Request,
|
||||
d.Version = p.version
|
||||
d.Now = time.Now().UTC().Format(time.RFC3339)
|
||||
d.CSRF = csrf
|
||||
// The menu's sign-out form too: it is the first form on the page.
|
||||
d.Nav = p.navFor(r, user, "keys")
|
||||
d.Nav.CSRF = csrf
|
||||
_ = sess
|
||||
|
||||
keys, err := p.keys.KeysForUser(r.Context(), user.ID)
|
||||
|
||||
Reference in new issue
Block a user