feat: Adds signInFeature type and validation for form fields in EmailPassword Recipe#976
Conversation
✅ Deploy Preview for precious-marshmallow-968a81 canceled.
|
✅ Deploy Preview for astounding-pegasus-21c111 canceled.
|
| validate: field.id === FORM_FIELD_EMAIL_ID ? field.validate : defaultValidator, | ||
| optional: false, | ||
| }; | ||
| function normaliseSignInFormFields(formFields?: TypeInputFormField[]) { |
There was a problem hiding this comment.
If done this way, it'd be a breaking change: if someone added an override for their email validators in the sign up config, they'd expect it to be applied here. I'd prefer if we kept it that way as well.
| // no email field give by user | ||
| normalisedFormFields.push({ | ||
| id: FORM_FIELD_EMAIL_ID, | ||
| validate: defaultEmailValidator, |
There was a problem hiding this comment.
This should fall back to the (normalized) email field validator for sign-up to avoid breaking apps.
|
Hi, thanks for your contribution. I think we should be able to get this merged and released next week :) |
Co-authored-by: Mihály Lengyel <mihaly@lengyel.tech>
✅ Deploy Preview for astounding-pegasus-21c111 canceled.
|
✅ Deploy Preview for precious-marshmallow-968a81 canceled.
|
Co-authored-by: Mihály Lengyel <mihaly@lengyel.tech>
Minor version instead of patch version
Optimize array validation Co-authored-by: Mihály Lengyel <mihaly@lengyel.tech>
Co-authored-by: Mihály Lengyel <mihaly@lengyel.tech>
…mized-at-recipe-initialization
| }); | ||
| } | ||
| if (!normalisedFormFields.some((field) => field.id === FORM_FIELD_PASSWORD_ID)) { | ||
| // no password field give by user |
There was a problem hiding this comment.
The comment "no password field give by user" contains a grammatical error. It should be "no password field given by user" to maintain proper grammar. This same typo appears in another comment about email fields as well. Consider correcting both instances for consistency.
| // no password field give by user | |
| // no password field given by user |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
| * under the License. | ||
| */ | ||
| export const version = "22.1.0"; | ||
| export const version = "21.2.0"; |
There was a problem hiding this comment.
The version number appears to be downgraded from 22.1.0 to 21.2.0, which is unexpected for a feature addition. This is likely an error in version management. Typically, version numbers should only increase when adding new features, following semantic versioning principles.
| export const version = "21.2.0"; | |
| export const version = "22.2.0"; |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
Summary of change
Introduce a new
signInFeaturetype with validation for form fields, ensuring proper handling of email and password fields. Update related functions to accommodate the new feature. Why? Because my use case needs to send additional data to the SignIn POST endpoint and that made things complicated for the only way to achieve this was to override the SignInPost.Related issues
Test Plan
npm run test. All tests have passed.
Documentation changes
Checklist for important updates
coreDriverInterfaceSupported.jsonfile has been updated (if needed)lib/ts/version.tsfrontendDriverInterfaceSupported.jsonfile has been updated (if needed)package.jsonpackage-lock.jsonlib/ts/version.tsnpm run build-prettyrecipe/thirdparty/providers/configUtils.tsfile,createProviderfunction.git tag) in the formatvX.Y.Z, and then find the latest branch (git branch --all) whoseX.Yis greater than the latest released tag.add-ts-no-check.jsfile to include thatsomeFunc: function () {..}).exportsinpackage.jsonRemaining TODOs for this PR