Skip to content

Commit e30060e

Browse files
taheerahmedclaude
andcommitted
Fix: Replace z.httpUrl() with z.url() for localhost compatibility
z.httpUrl() rejects localhost URLs, causing Zod validation errors during local development when verifying email. z.url() still validates URL structure while accepting localhost, and the existing isExternalOrigin checks already handle redirect security. Closes #241 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d83c4d0 commit e30060e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/api/auth/confirm/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { z } from 'zod'
99
const confirmSchema = z.object({
1010
token_hash: z.string().min(1),
1111
type: OtpTypeSchema,
12-
next: z.httpUrl(),
12+
next: z.url(),
1313
})
1414

1515
/**

src/server/api/models/auth.models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export type OtpType = z.infer<typeof OtpTypeSchema>
1414
export const ConfirmEmailInputSchema = z.object({
1515
token_hash: z.string().min(1),
1616
type: OtpTypeSchema,
17-
next: z.httpUrl(),
17+
next: z.url(),
1818
})
1919

2020
export type ConfirmEmailInput = z.infer<typeof ConfirmEmailInputSchema>

0 commit comments

Comments
 (0)