Skip to content

fix: add type="submit" to forgot password form button#4910

Merged
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
lihan3238:fix/forgot-password-submit
May 19, 2026
Merged

fix: add type="submit" to forgot password form button#4910
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
lihan3238:fix/forgot-password-submit

Conversation

@lihan3238

@lihan3238 lihan3238 commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds type="submit" to the primary "Send reset email" <Button> in the forgot password form, enabling form submission when the button is clicked.
  • All other auth forms (sign-in, sign-up, OTP, reset-password-confirm) already have this attribute set correctly on their submit buttons.

Closes #4793

Root Cause

The <Button> component defaults to type="button", which does not trigger form submission. Since the <form> element uses onSubmit={form.handleSubmit(onSubmit)}, clicking the button without type="submit" fires a click event but never invokes the form's submit handler.

Test Plan

  • Code change is a single attribute addition, consistent with other auth forms
  • Manual test: navigate to /forgot-password, enter email, click "Send reset email", verify XHR request fires and success toast appears

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the forgot password form's submit button to properly function as a form submission trigger.

Review Change Stack

The "Send reset email" button was missing type="submit", preventing
form submission when clicked. All other auth forms (sign-in, sign-up,
OTP) already have this attribute set correctly.

Closes QuantumNous#4793
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 43e8126f-3330-4027-b41e-d5c9ff17c2e3

📥 Commits

Reviewing files that changed from the base of the PR and between 132d7b9 and 850cae5.

📒 Files selected for processing (1)
  • web/default/src/features/auth/forgot-password/components/forgot-password-form.tsx

Walkthrough

The forgot-password form's submit button now explicitly declares type='submit', ensuring standard form submission behavior. This fixes an issue where clicking the button did not trigger the form's onSubmit handler.

Changes

Form Submission Fix

Layer / File(s) Summary
Submit button type attribute
web/default/src/features/auth/forgot-password/components/forgot-password-form.tsx
The submit button now includes explicit type='submit' to ensure form submission triggers the onSubmit handler when clicked.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A button that whispers "submit" with pride,
No form submission shall ever hide!
One type attribute, so simple yet true,
Makes forgotten passwords reset anew. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding type="submit" to the forgot password form button, which directly addresses the issue.
Linked Issues check ✅ Passed The code change directly implements the requirement from issue #4793 by adding type="submit" to the Button component, enabling form submission.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to adding a single attribute to the button, staying fully within the scope of fixing the form submission issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion Calcium-Ion left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving. Minimal 1-line type="submit" addition restores the existing react-hook-form onSubmit on web/default/src/features/auth/forgot-password/components/forgot-password-form.tsx. Pattern matches the other auth forms in this directory. Fixes #4793.

Note: #4794 applies the same one-line fix and will be closed as duplicate in favor of this PR.

@Calcium-Ion Calcium-Ion merged commit ee9736b into QuantumNous:main May 19, 2026
2 checks passed
reggie-lula pushed a commit to WhaleCrane/new-api-hz that referenced this pull request May 21, 2026
The "Send reset email" button was missing type="submit", preventing
form submission when clicked. All other auth forms (sign-in, sign-up,
OTP) already have this attribute set correctly.

Closes QuantumNous#4793
xyfacai pushed a commit to xyfacai/new-api that referenced this pull request May 30, 2026
The "Send reset email" button was missing type="submit", preventing
form submission when clicked. All other auth forms (sign-in, sign-up,
OTP) already have this attribute set correctly.

Closes QuantumNous#4793
SamuelSxy pushed a commit to SamuelSxy/new-api-rh that referenced this pull request Jun 7, 2026
The "Send reset email" button was missing type="submit", preventing
form submission when clicked. All other auth forms (sign-in, sign-up,
OTP) already have this attribute set correctly.

Closes QuantumNous#4793
fx247562340 pushed a commit to fx247562340/vancine-platform that referenced this pull request Jun 11, 2026
The "Send reset email" button was missing type="submit", preventing
form submission when clicked. All other auth forms (sign-in, sign-up,
OTP) already have this attribute set correctly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forgot password form does not submit from reset email button

2 participants