Skip to content

fix: add 'Forgot password' flow to login and server-side reset email#191

Open
evrendom wants to merge 2 commits intomainfrom
codex/add-forgot-password-option-to-login
Open

fix: add 'Forgot password' flow to login and server-side reset email#191
evrendom wants to merge 2 commits intomainfrom
codex/add-forgot-password-option-to-login

Conversation

@evrendom
Copy link
Copy Markdown
Collaborator

@evrendom evrendom commented Apr 7, 2026

Motivation

  • Users cannot recover their account because there was no “Forgot password” option on the login screen and no integrated reset flow.
  • Provide a complete client + server flow so users can request a reset email and set a new password via a tokenized reset page.

Description

  • Added a “Forgot password?” action to the login UI that calls authClient.requestPasswordReset, validates an entered email, and shows success/error status to the user (apps/web/src/components/auth/login-form.tsx).
  • Added a new ResetPasswordForm component that reads the token/error from the URL and submits authClient.resetPassword to complete the reset (apps/web/src/components/auth/reset-password-form.tsx).
  • Updated app routing/rendering to surface the reset UI at /reset-password for unauthenticated users (apps/web/src/App.tsx).
  • Hooked Better Auth server-side emailAndPassword.sendResetPassword to a new sendPasswordResetEmail helper and added buildPasswordResetEmailContent to compose and send reset emails via Resend (apps/api/src/auth.ts, apps/api/src/email.ts).

Testing

  • Ran bun run verify which failed in this environment due to a missing doppler binary and exited early (verify could not complete).
  • Ran bun run lint which failed because biome was not available in the environment (dependencies not installed).
  • Attempted bun install but dependency installs failed due to registry/network 403 responses, preventing running the full test/lint/verify suites.

Codex Task

@evrendom evrendom marked this pull request as ready for review April 7, 2026 14:26
@evrendom evrendom requested a review from KeKs0r April 7, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant