Optionally require fields before sending login link / logging-in #509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the ability, optionally, to require fields to be answered before a user receives a login link. This behavior is only applicable to unverified (new) users only -- this was done to prevent unauthenticated requests from modifying verified user data. This requires base-cms/id-me#81 to be merged and deployed.
To enable, the
requiredLoginFields
array must be set in the implementing website's IdentityX config. The fields that can be required are:For example:
If a locale field is set (e.g.
countryCode
) the regional consent questions will also be prompted if a user selects a country with an enabled consent policy in IdentityX (e.g. Canada or the EU, etc).Example flow:
Standard login screen
![image](https://user-images.githubusercontent.com/3289485/107287948-50193f00-6a28-11eb-9b63-51fa7115bb57.png)
If the user is unverified and is missing the configured fields, they will be asked before sending the login link
![image](https://user-images.githubusercontent.com/3289485/107288033-6e7f3a80-6a28-11eb-8749-a65e27dccfaf.png)
If a country is selected that has a regional consent question, it will also be prompted
![image](https://user-images.githubusercontent.com/3289485/107288097-85be2800-6a28-11eb-8ccb-ab7cf607b456.png)
Once submitted, the login link will be sent as normal
![image](https://user-images.githubusercontent.com/3289485/107288141-966e9e00-6a28-11eb-8251-8a2865cb66c1.png)
The remaining authentication flow remains the same.