Skip to content

feat(auth): add confirm password field to registration form#33

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/update-signup-confirm-password
Open

feat(auth): add confirm password field to registration form#33
Copilot wants to merge 3 commits into
mainfrom
copilot/update-signup-confirm-password

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

Require users to repeat their password during sign-up to prevent typos.

  • Schema (lib/validations/auth.ts): Added confirmPassword to registerSchema with .refine() match check, consistent with existing resetPasswordSchema pattern
  • Form (components/auth/register-form.tsx): Added "Confirm Password" input field and state
  • Unit tests (lib/validations/auth.test.ts): Covers matching, mismatched, and missing confirm password cases
  • E2E tests (e2e/auth/register.spec.ts): Updated all tests to fill confirm password; added password mismatch test; uses { exact: true } on Password label to disambiguate from Confirm Password

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rxlab-auth Ready Ready Preview, Comment Mar 7, 2026 3:53am

Request Review

Copilot AI and others added 2 commits March 7, 2026 03:52
Co-authored-by: sirily11 <32106111+sirily11@users.noreply.github.com>
Co-authored-by: sirily11 <32106111+sirily11@users.noreply.github.com>
Copilot AI changed the title [WIP] Add password confirmation to signup process Add confirm password field to registration form Mar 7, 2026
@sirily11 sirily11 marked this pull request as ready for review March 8, 2026 11:59
Copilot AI review requested due to automatic review settings March 8, 2026 11:59
@autopilot-project-manager autopilot-project-manager Bot changed the title Add confirm password field to registration form feat(auth): add confirm password field to registration form Mar 8, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “Confirm Password” field to the registration flow to prevent password typos during sign-up, aligning registration validation with the existing reset-password pattern.

Changes:

  • Extended registerSchema with confirmPassword and a password match .refine().
  • Updated the registration form UI/state to collect and submit confirmPassword.
  • Added/updated unit + E2E test coverage for confirm-password behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
lib/validations/auth.ts Adds confirmPassword to registration validation and enforces password match via .refine().
components/auth/register-form.tsx Adds confirm-password input and includes it in the server action payload.
lib/validations/auth.test.ts New unit tests covering valid/mismatch/missing confirm-password cases.
e2e/auth/register.spec.ts Updates registration E2E coverage to fill confirm password and adds mismatch scenario.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/validations/auth.ts
Comment on lines 27 to 35
export const registerSchema = z.object({
email: emailSchema,
password: passwordSchema,
confirmPassword: z.string(),
displayName: displayNameSchema.optional(),
}).refine((data) => data.password === data.confirmPassword, {
message: "Passwords do not match",
path: ["confirmPassword"],
});
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmPassword uses z.string() without a .min(1, ...), so when the field is missing/empty the returned Zod message will be the generic "Required" (and this is surfaced to users via parsed.error.issues[0]?.message). Consider adding an explicit required message (e.g., .min(1, "Confirm password is required")) to keep error messaging consistent with emailSchema / displayNameSchema.

Copilot uses AI. Check for mistakes.
Comment thread e2e/auth/register.spec.ts
Comment on lines +10 to +11
await expect(page.getByLabel("Password", { exact: true })).toBeVisible();
await expect(page.getByLabel("Confirm Password")).toBeVisible();
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other E2E specs use the shared registerUser helper (e2e/fixtures/test-helpers.ts) which still does getByLabel("Password") and does not fill the now-required Confirm Password field. With two password-labeled inputs, this will likely become ambiguous and the submission will be blocked by HTML required validation. Update the helper (and any other E2E tests) to use getByLabel("Password", { exact: true }) and fill Confirm Password so the full E2E suite continues to pass.

Copilot uses AI. Check for mistakes.
@sirily11 sirily11 enabled auto-merge (squash) March 11, 2026 08:31
@blacksmith-sh
Copy link
Copy Markdown

blacksmith-sh Bot commented Mar 11, 2026

Found 18 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › e2e/admin/
sign-in-permission.spec.ts:169:9 › Client Sign-in Permission › OAuth Flow Enforcement ›
should block sign-in when permission is set to none
View Logs
[chromium] › e2e/admin/
signup-settings.spec.ts:106:7 › Sign-up Settings › should allow whitelisted email to si
gn up even when public sign-up is disabled
View Logs
[chromium] › e2e/admin/
signup-settings.spec.ts:50:7 › Sign-up Settings › should allow sign-up when public sign
-up is enabled
View Logs
[chromium] › e2e/admin/
signup-settings.spec.ts:74:7 › Sign-up Settings › should block non-whitelisted email wh
en whitelist is enabled
View Logs
[chromium] › e2e/admin/
users.spec.ts:136:7 › Toggle User Verification › should show toggle verified option in
actions menu
View Logs
[chromium] › e2e/admin/
users.spec.ts:68:7 › User Search › should filter users by email ────────
View Logs
[chromium] › e2e/admin/
users.spec.ts:90:7 › User Search › should filter users by display name ─
View Logs
[chromium] › e2e/auth/
delete-account.spec.ts:45:7 › Account Deletion › should not allow login after account d
eletion
View Logs
[chromium] › e2e/auth/
delete-account.spec.ts:4:7 › Account Deletion › should delete account via API and inval
idate session
View Logs
[chromium] › e2e/auth/
login.spec.ts:25:7 › User Login › should show login form ───────────────
View Logs
[chromium] › e2e/auth/
passkey.spec.ts:40:7 › Passkey Authentication › should show passkey management page
View Logs
[chromium] › e2e/auth/
passkey.spec.ts:96:7 › Passkey with Virtual Authenticator › should register and use pas
skey
View Logs
[chromium] › e2e/auth/
password-reset.spec.ts:25:7 › Password Reset - Single Use Token › should show forgot pa
ssword form
View Logs
[chromium] › e2e/oauth/
consent.spec.ts:58:7 › OAuth Consent Flow › should redirect to login when not authentic
ated
View Logs
[chromium] › e2e/oauth/
public-client.spec.ts:72:7 › OAuth Public Client Flow › should complete authorization c
ode flow without client_secret
View Logs
[chromium] › e2e/oauth/
refresh-token.spec.ts:69:7 › OAuth Refresh Token Flow › should exchange authorization c
ode for tokens including refresh_token
View Logs
[chromium] › e2e/oauth/
user-id-consistency.spec.ts:67:7 › User ID Consistency › user ID from sign-in should eq
ual user ID from refresh token
View Logs
[chromium] › e2e/oauth/
wildcard-redirect.spec.ts:77:7 › OAuth Wildcard Redirect URI › should accept matching w
ildcard redirect URI via API
View Logs

Fix in Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants