Stacks.js: Email scope does not return email address when requested

Created on 9 May 2019  路  5Comments  路  Source: blockstack/stacks.js

userSession.loadUserData().email

does not return the user's email.

bug

All 5 comments

@jefreybulla did you try restoring an ID with the latest version of the browser? If you created the ID on versions prior to v0.36.0, the email didn't get persisted to storage. You will need to reset the browser and restore using your recovery code or seed phrase.

@jefreybulla To clarify what is happening, users who are _already signed into the Browser_ (web or client) have profiles that are running under the last version of the browser. The email wasn't available. When your code attempts to access the email for these users, the email isn't available in the old profile. If users use the Reset function on the Blockstack Browser, the reset will update the user profile and your function would return it.

We acknowledge this is not the best of situations. We are thinking about solutions such as allowing users to set or update their email when they are signing in with the email scope.

To add to Mary's point, I would recommend that you develop your application with this limitation in mind, depending on how you want to use their email. For example, we don't do any confirmation of emails.

Regardless, I think the best way to develop your app is to give the user a way to specify the email they want to use when they login to your app, and you can use the email you get from Blockstack auth as a default value. After all, users may want to use a different email address in your app.

Closing as this bug should already be fixed. Please re-open if the issue persists.

Was this page helpful?
0 / 5 - 0 ratings