isLoggedIn = NostrAuth::check(); if (! $this->isLoggedIn) { // Sidebar + navbar mount the same component on the same page; using // currentOrIssueChallenge keeps both rendered data-attributes // pointing at the same live session value. $this->nostrChallenge = NostrAuth::currentOrIssueChallenge(); } } /** * JS-driven fallback: re-issue the challenge if the client cannot find * one in the rendered snapshot (e.g. after a long-lived tab where the * Volt component snapshot drifted out of sync with the session). */ public function requestNostrChallenge(): string { $challenge = NostrAuth::issueChallenge(); $this->nostrChallenge = $challenge; return $challenge; } #[On('nostrLoggedIn')] public function handleNostrLoggedIn($signedEvent = null): void { NostrAuth::loginWithSignedEvent($signedEvent); $this->js('window.location.reload(true);'); } #[On('nostrLoggedOut')] public function handleNostrLoggedOut(): void { $this->isLoggedIn = false; } } ?>
@if($isLoggedIn)
@csrf Logout
@else Mit Nostr verbinden @endif {{-- Full-viewport progress overlay. Visible while the wallet-signing round-trip is running. Locks input by capturing pointer events and intercepting Escape/Tab so the user cannot interact with anything underneath until the redirect resolves (or the flow errors out). --}}