The previous commit only updated auth-button + the WithNostrAuth trait,
but six Volt pages (profile, benefits, election/*, members/admin) carry
their own handleNostrLoggedIn(string $pubkey) handlers. The dispatched
payload is now an array, so Livewire's container could not resolve the
string parameter and threw BindingResolutionException on every login.
- All six per-page handlers now accept the signed event and route it
through NostrAuth::loginWithSignedEvent() like the trait does.
- NostrAuth: add currentOrIssueChallenge() so the sidebar + navbar
auth-button mounts share one live session challenge instead of
overwriting each other.
- verifySignedEvent: pass a normalized stdClass to swentel's verify()
directly, skipping an unnecessary json_encode + json_decode round-trip.
- auth-button: gate the global Escape/Tab capture so it only intercepts
keys while the overlay is actually visible.
- Update three test files that still called handleNostrLoggedIn with a
raw pubkey to authenticate via NostrAuth::login() instead.
Closes a security flaw where the server trusted any pubkey the client
sent. The frontend now signs a per-session, time-bound challenge
(kind-22242 event) that the backend verifies with swentel/nostr-php
before establishing the session.
- NostrAuth: issueChallenge() + loginWithSignedEvent() with full
schnorr/id verification, TTL window, and idempotent re-entry for
concurrent Livewire listeners.
- auth-button: mounts a fresh challenge, exposes it via data-attribute
+ requestNostrChallenge() fallback, renders a full-viewport AAA-style
loading overlay while the wallet signs.
- NostrSessionGuard: override logout() to drop the cookie-jar dep so
programmatic logout works in any context.