USR-193 fix(clerk-js): Introduce ability to read multiple errors#1505
USR-193 fix(clerk-js): Introduce ability to read multiple errors#1505
Conversation
🦋 Changeset detectedLatest commit: 3457bce The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
panteliselef
left a comment
There was a problem hiding this comment.
The UX feels like what we want to accomplish, let's focus on getting the code in the right state
114d382 to
3c1d958
Compare
3c1d958 to
e00ab20
Compare
fe2066d to
faf6f13
Compare
faf6f13 to
01a3661
Compare
|
!snapshot |
|
Hey @SokratisVidros - the snapshot version command generated the following package versions:
Tip: use the snippet copy button below to quickly install the required packages. # @clerk/backend
npm i @clerk/backend@0.26.0# @clerk/chrome-extension
npm i @clerk/chrome-extension@0.3.26-snapshot.01a3661# @clerk/clerk-js
npm i @clerk/clerk-js@4.54.3-snapshot.01a3661# eslint-config-custom
npm i eslint-config-custom@0.3.0# @clerk/clerk-expo
npm i @clerk/clerk-expo@0.18.17-snapshot.01a3661# @clerk/fastify
npm i @clerk/fastify@0.6.2# gatsby-plugin-clerk
npm i gatsby-plugin-clerk@4.4.3# @clerk/localizations
npm i @clerk/localizations@1.24.0# @clerk/nextjs
npm i @clerk/nextjs@4.23.1# @clerk/clerk-react
npm i @clerk/clerk-react@4.23.1# @clerk/remix
npm i @clerk/remix@2.9.0# @clerk/clerk-sdk-node
npm i @clerk/clerk-sdk-node@4.12.1# @clerk/shared
npm i @clerk/shared@0.20.0# @clerk/themes
npm i @clerk/themes@1.7.5# @clerk/types
npm i @clerk/types@3.48.1 |
fix(clerk-js): Introduce ability to read multiple errors fix(clerk-js): Introduce ability to read multiple errors
fix(clerk-js): Add changeset
fix(clerk-js): Refactor addFullStop util fix(clerk-js): Make handling of multiple errors more generic
01a3661 to
54e0397
Compare
| | { | ||
| type: Extract<HTMLInputTypeAttribute, 'password'>; | ||
| validatePassword: boolean; | ||
| buildErrorMessage?: (err: ClerkAPIError[]) => ClerkAPIError | string | undefined; |
There was a problem hiding this comment.
❤️ Loving this, as it depends on the type of the input and not the name
fix(clerk-js): Minor refactor
54e0397 to
3457bce
Compare
|
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Type of change
Packages affected
@clerk/clerk-js@clerk/clerk-react@clerk/nextjs@clerk/remix@clerk/types@clerk/themes@clerk/localizations@clerk/clerk-expo@clerk/backend@clerk/clerk-sdk-node@clerk/shared@clerk/fastify@clerk/chrome-extensiongatsby-plugin-clerkbuild/tooling/choreDescription
npm testruns as expected.npm run buildruns as expected.Currently, client-side password validation constructs dynamically all error messages based on the password complexity settings. In this PR we want to support reading multiple errors in order to construct a password error with information
that comes from FAPI. This way we can achieve parity between password client-side validations and errors
returned from FAPI, resulting in the same exact message.
Currently, we support handling only one error object that comes from FAPI so if we have many errors regarding passwords(e.g. too short password, uppercase required, lowercase required) it will only show the first. We want the error handler to read all incoming errors(only password relating errors will be multiple) so a more concise password can be shown.
Before
Screen.Recording.2023-07-21.at.10.32.05.AM.mov
After
Screen.Recording.2023-07-20.at.7.05.52.PM.mov