mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-03 04: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:
@@ -21,6 +21,24 @@ state(['isAllowed' => false]);
|
||||
state(['currentPubkey' => null]);
|
||||
state(['members' => []]);
|
||||
|
||||
mount(function () {
|
||||
if (\App\Support\NostrAuth::check()) {
|
||||
$this->currentPubkey = \App\Support\NostrAuth::pubkey();
|
||||
$this->currentPleb = \App\Models\EinundzwanzigPleb::query()
|
||||
->where('pubkey', $this->currentPubkey )->first();
|
||||
$allowedPubkeys = [
|
||||
'0adf67475ccc5ca456fd3022e46f5d526eb0af6284bf85494c0dd7847f3e5033',
|
||||
'430169631f2f0682c60cebb4f902d68f0c71c498fd1711fd982f052cf1fd4279',
|
||||
'7acf30cf60b85c62b8f654556cc21e4016df8f5604b3b6892794f88bb80d7a1d',
|
||||
'f240be2b684f85cc81566f2081386af81d7427ea86250c8bde6b7a8500c761ba',
|
||||
'19e358b8011f5f4fc653c565c6d4c2f33f32661f4f90982c9eedc292a8774ec3',
|
||||
];
|
||||
if (in_array($this->currentPubkey, $allowedPubkeys, true)) {
|
||||
$this->isAllowed = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
on([
|
||||
'nostrLoggedOut' => function () {
|
||||
$this->isAllowed = false;
|
||||
|
||||
Reference in New Issue
Block a user