Skip to content

[Bug] Signup form silently fails due to missing selectedRole in validateForm call #3579

Description

@Ananya-CM

Description

The signup form on /auth?mode=signup does not respond when the "Create Account"
button is clicked. No error is shown, no network request is made, and the form
stays frozen. This is because validateForm() in auth/page.js expects
selectedRole inside the formData object, but AuthForm.js only passes its
local form state (email, password, fullName, etc.) without including selectedRole.

This causes the role validation check to always fail silently:

// In utils/authUtils.js
if (!selectedRole) {
  errors.role = "Please select your role"; // always triggers
}

Steps to Reproduce

  1. Go to /auth?mode=signup
  2. Select any role (e.g. Student)
  3. Fill in Full Name, Email, Password, Confirm Password
  4. Click "Create Account"
  5. Nothing happens — no error, no request, no redirect

Expected Behavior

The form should either submit successfully and redirect to /verify,
or display a visible validation error if something is wrong.

Root Cause

In app/auth/page.js, the handleSubmit function calls:

validateForm(formData, isLogin)

But formData comes from AuthForm's local state which does not include
selectedRole. The fix is:

validateForm({ ...formData, selectedRole }, isLogin)

Screenshots

Image

Environment

  • OS: Windows 11
  • Browser: Chrome
  • Version: Next.js 15.5.19

Metadata

Metadata

Assignees

Labels

GSSoC'26Part of GirlScript Summer of Code 2026bugSomething isn't workingmentor:Ayushh-SharmaaGSSoC: Mentor — @Ayushh-Sharmaa

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions