ScatterWebExtension icon indicating copy to clipboard operation
ScatterWebExtension copied to clipboard

Support optional fields when requesting identities

Open liamcurry opened this issue 7 years ago • 1 comments

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:

image 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' ] })

liamcurry avatar Jun 19 '18 02:06 liamcurry

Definitely interesting idea. I could see the UI for optional fields looking something like this:

image

Soleone avatar Jun 19 '18 05:06 Soleone