You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we auto-prompt a user, then it negates the "sign in" button. If we decide not to potentially auto-prompt non-logged in users, we have no way of knowing when a user navigates to the page and has already connected in the past.
We can store an active connection in localStorage or a database, but then if the user manually disconnects via Nautilus, the dapp will think they're logged in. It will then use the ergoConnector.nautilus.connect() to instantiate the API, causing an automatic wallet selection prompt. If the app is operating under the premise that the user chose a specific wallet before, and now the user chooses a different one, there are differences between the user's connected wallet and the app session.
The app can compare the two, but then a new session must be created. Sometimes, this forces a page refresh (like with next-auth), and the user-flow is interrupted and not automatically started again.
The text was updated successfully, but these errors were encountered:
const checkDappConnection = async () => {
const isNautilusConnected = await window.ergoConnector.nautilus.isConnected();
if (!isNautilusConnected) {
console.log('Nautilus not connected')
}
else console.log('Nautilus is connected')
}
checkDappConnection();
This code always returns "Nautilus not connected"
When changed to const isNautilusConnected = await window.ergoConnector.nautilus.connect(); it works as intended when they are connected, but it prompts a connection when they are not connected (which is not the desired functionality for this app)
When a user navigates to a page, we need a way to check if they have an active nautilus connection.
This is problematic because it will automatically prompt the user to choose a wallet if they haven't already connected one:
If we auto-prompt a user, then it negates the "sign in" button. If we decide not to potentially auto-prompt non-logged in users, we have no way of knowing when a user navigates to the page and has already connected in the past.
We can store an active connection in localStorage or a database, but then if the user manually disconnects via Nautilus, the dapp will think they're logged in. It will then use the
ergoConnector.nautilus.connect()
to instantiate the API, causing an automatic wallet selection prompt. If the app is operating under the premise that the user chose a specific wallet before, and now the user chooses a different one, there are differences between the user's connected wallet and the app session.The app can compare the two, but then a new session must be created. Sometimes, this forces a page refresh (like with next-auth), and the user-flow is interrupted and not automatically started again.
The text was updated successfully, but these errors were encountered: