Skip to content

Adds window.nostr.peekPublicKey#2233

Open
arthurfranca wants to merge 1 commit intonostr-protocol:masterfrom
arthurfranca:autologin
Open

Adds window.nostr.peekPublicKey#2233
arthurfranca wants to merge 1 commit intonostr-protocol:masterfrom
arthurfranca:autologin

Conversation

@arthurfranca
Copy link
Contributor

The nip07's "peekPublicKey" method is a way for extensions to provide an auto-login feature.
If extension's user has previously enabled auto-login, window.nostr.peekPublicKey() returns the same as window.nostr.getPublicKey(), though won't prompt the user for confirmation.

Expected flow is that apps should do the following on page load, without the need for the user to click a button:

const maybePubkey = await window.nostr?.peekPublicKey?.()
if (maybePubkey) loginUser(maybePubkey)

Implemented at 44billion.net. There, auto-login is always on, i.e. the user logs in to 44billion.net then when it opens an app inside the platform, if the app has the above code running, the app learns what is the user's pubkey automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant