Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling automatic WebLN login #48

Open
adambor opened this issue Mar 17, 2024 · 0 comments
Open

Handling automatic WebLN login #48

adambor opened this issue Mar 17, 2024 · 0 comments

Comments

@adambor
Copy link

adambor commented Mar 17, 2024

Some wallets (like Alby) allow you to enable automatic website logins. Is there any way to detect that and log the user in automatically (call requestProvider) in that case?

One way is to save whether the user used a WebLN wallet last time he was on the website (and save it to the local storage). Then try to call requestProvider when he visits next time, but in this case when user doesn't have the automatic logins enabled it will just annoyingly pop up his wallet.

A fix could be a parameter in the requestProvider method (something like "noPopup"), which would return the provider only if it doesn't require popping up (otherwise returns null or throws), then one can try calling that on page load to see if any provider is "connected" to the website already without annoying the user with a pop up.

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

No branches or pull requests

1 participant