mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-07 09:00:15 +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:
@@ -31,6 +31,17 @@ state([
|
||||
'currentPleb' => null,
|
||||
]);
|
||||
|
||||
mount(function () {
|
||||
if (\App\Support\NostrAuth::check()) {
|
||||
$this->currentPubkey = \App\Support\NostrAuth::pubkey();
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()->where('pubkey', $this->currentPubkey)->first();
|
||||
if (in_array($this->currentPleb->npub, config('einundzwanzig.config.current_board'), true)) {
|
||||
$this->canEdit = true;
|
||||
}
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
});
|
||||
|
||||
on([
|
||||
'nostrLoggedIn' => function ($pubkey) {
|
||||
$this->currentPubkey = $pubkey;
|
||||
|
||||
Reference in New Issue
Block a user