ScatterWebExtension
ScatterWebExtension copied to clipboard
Support optional fields when requesting identities
Currently when requesting identities with scatter.getIdentity you can optionally specify required fields. If a user doesn't have an identity with all the required fields they are shown this message:
It would be useful to have optional fields for info that is nice to have but shouldn't block a user from logging in, like the user's first name.
To avoid any breaking changes this could be implemented as a second optional parameter to scatter.getIdentity. For example:
// no args
scatter.getIdentity()
// required country
scatter.getIdentity({ location: [ 'country' ] })
// required country, optional first name
scatter.getIdentity({ location: [ 'country' ] }, { personal: [ 'firstname' ] })
// no required fields, optional first name
scatter.getIdentity(null, { personal: [ 'firstname' ] })
// if a field is in both required and optional args, assume it is required
scatter.getIdentity({ personal: [ 'firstname' ] }, { personal: [ 'firstname' ] })
Definitely interesting idea. I could see the UI for optional fields looking something like this:
