-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ui): Format safe identifier phone number during sign in verification step #3751
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved, but if you want to get rid of that logical OR we can by adding a few overloads to formatSafeIdentifier
<SignIn.SafeIdentifier /> | ||
<SignIn.SafeIdentifier | ||
transform={val => { | ||
return formatSafeIdentifier(val) || val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add some overloads to the formatSafeIdentifier
function to tell TypeScript that it will always return a string if provided a string, we can remove this logical OR which won't ever be invoked since SafeIdentifier
falls back to an empty string in the worse case.
@@ -0,0 +1,15 @@ | |||
import { stringToFormattedPhoneString } from '~/common/phone-number-field/utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think we should move this to ~/utils
if it's something we plan to use across different areas of the codebase; this'll avoid the likelihood of circular imports (and just a little tidier)
I may go ahead and just make this change to avoid the back-and-forth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooof actually just seen how this also relies on data
etc. too. Let's come back to this
a0f37ef
into
ds.feat/safeidentifier-for-strategy
Description
Add formatSafeIdentifier util to format phone number during sign in verification step
BEFORE:
AFTER:
https://linear.app/clerk/issue/SDKI-121/signin-verifications-phone-number-should-be-formatted-according-to
Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change