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
- Go to
/auth?mode=signup
- Select any role (e.g. Student)
- Fill in Full Name, Email, Password, Confirm Password
- Click "Create Account"
- 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
Environment
- OS: Windows 11
- Browser: Chrome
- Version: Next.js 15.5.19
Description
The signup form on
/auth?mode=signupdoes 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()inauth/page.jsexpectsselectedRoleinside theformDataobject, butAuthForm.jsonly passes itslocal form state (email, password, fullName, etc.) without including
selectedRole.This causes the role validation check to always fail silently:
Steps to Reproduce
/auth?mode=signupExpected 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, thehandleSubmitfunction calls:But
formDatacomes fromAuthForm's local state which does not includeselectedRole. The fix is:Screenshots
Environment