Files
einundzwanzig-portal/resources/views/livewire/auth/login-with-n-d-k.blade.php
fsociety f4c46b0011 feat: update URL endpoints for Nostr services
This commit updates the URL endpoints used for Nostr related services from .de to .top domains. This includes the relay URLs for plebs overview and login services, as well as the redirect URL for the einundzwanzig-plebs route.
2024-06-07 12:22:47 +02:00

53 lines
1.7 KiB
PHP

<x-jet-authentication-card>
<x-slot name="logo">
<x-jet-authentication-card-logo/>
</x-slot>
<div>
<div
wire:ignore
x-data="{
userProfile: @entangle('userProfile'),
init() {
const nip07signer = new window.NDKNip07Signer();
const ndk = new window.NDK({
explicitRelayUrls: ['wss://nostr.codingarena.top'],
signer: nip07signer
});
ndk.connect();
},
login() {
nip07signer.user().then(async (user) => {
if (!!user.npub) {
console.log('user pub: ' + user.npub);
const ndkUser = ndk.getUser({
npub: user.npub,
});
await ndkUser.fetchProfile();
console.log(ndkUser);
this.userProfile = ndkUser.profile;
}
});
}
}"
>
<div class="space-y-6" x-init="init()">
<x-button x-show="!userProfile.npub" primary label="NIP-07 Login" icon="login" @click="login()"/>
<p x-text="userProfile.npub"></p>
<p x-text="userProfile.about"></p>
<img :src="userProfile.image" alt="image"/>
</div>
</div>
@if($existingAccount)
<div class="mt-12 text-red-500 space-y-6">
<p>Es existiert ein Account mit dem npub {{ $userProfile['npub'] }}</p>
</div>
@endif
</div>
</x-jet-authentication-card>