mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-27 21:30:16 +00:00
🔒 Add Nostr authentication support with custom guard and user provider
🛠️ Integrate Nostr auth across relevant components and views 📦 Update config, routes, and service provider for Nostr auth
This commit is contained in:
@@ -28,6 +28,13 @@ state([
|
||||
'otherVotes' => fn() => $this->getOtherVotes(),
|
||||
]);
|
||||
|
||||
mount(function () {
|
||||
if (\App\Support\NostrAuth::check()) {
|
||||
$this->currentPubkey = \App\Support\NostrAuth::pubkey();
|
||||
$this->handleNostrLoggedIn($this->currentPubkey);
|
||||
}
|
||||
});
|
||||
|
||||
on([
|
||||
'nostrLoggedIn' => fn($pubkey) => $this->handleNostrLoggedIn($pubkey),
|
||||
'nostrLoggedOut' => fn() => $this->handleNostrLoggedOut(),
|
||||
|
||||
@@ -31,6 +31,14 @@ mount(function ($projectProposal) {
|
||||
|
||||
usesFileUploads();
|
||||
|
||||
mount(function () {
|
||||
if (\App\Support\NostrAuth::check()) {
|
||||
$this->currentPubkey = \App\Support\NostrAuth::pubkey();
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $this->currentPubkey)->first();
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
});
|
||||
|
||||
on([
|
||||
'nostrLoggedIn' => function ($pubkey) {
|
||||
$this->currentPubkey = $pubkey;
|
||||
|
||||
@@ -25,6 +25,14 @@ state([
|
||||
|
||||
usesFileUploads();
|
||||
|
||||
mount(function () {
|
||||
if (\App\Support\NostrAuth::check()) {
|
||||
$this->currentPubkey = \App\Support\NostrAuth::pubkey();
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $this->currentPubkey)->first();
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
});
|
||||
|
||||
on([
|
||||
'nostrLoggedIn' => function ($pubkey) {
|
||||
$this->currentPubkey = $pubkey;
|
||||
|
||||
@@ -55,6 +55,14 @@ $projects = computed(function () {
|
||||
return $this->projects;
|
||||
});
|
||||
|
||||
mount(function () {
|
||||
if (\App\Support\NostrAuth::check()) {
|
||||
$this->currentPubkey = \App\Support\NostrAuth::pubkey();
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $this->currentPubkey)->first();
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
});
|
||||
|
||||
on([
|
||||
'nostrLoggedIn' => function ($pubkey) {
|
||||
$this->currentPubkey = $pubkey;
|
||||
|
||||
Reference in New Issue
Block a user