Skip to content

Commit efee4f5

Browse files
committed
Fix: duplicate check normalization must match registration logic
The duplicate user check in superRefine now extracts digits only (using /\D/g) to match the registration normalization, preventing users from bypassing the duplicate check with formatted phone numbers like 555-123-4567.
1 parent 8d2a463 commit efee4f5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/routes/_app+/_auth+/signup.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export async function action({ request }: ActionFunctionArgs) {
4444

4545
const submission = await parseWithZod(formData, {
4646
schema: SignupSchema.superRefine(async (data, ctx) => {
47-
const fullPhoneNumber = `${data.countryCode}${data.phoneNumber}`.replace(
47+
const digitsOnly = data.phoneNumber.replace(/\D/g, '')
48+
const fullPhoneNumber = `${data.countryCode}${digitsOnly}`.replace(
4849
/\s+/g,
4950
'',
5051
)

0 commit comments

Comments
 (0)