Skip to content

fix(auth): allow password reset on self-hosted (remove IS_CLOUD gate on reset pages)#4665

Open
nizepart wants to merge 1 commit into
Dokploy:canaryfrom
nizepart:fix/self-hosted-reset-password
Open

fix(auth): allow password reset on self-hosted (remove IS_CLOUD gate on reset pages)#4665
nizepart wants to merge 1 commit into
Dokploy:canaryfrom
nizepart:fix/self-hosted-reset-password

Conversation

@nizepart

Copy link
Copy Markdown

What

Removes the !IS_CLOUD redirect in getServerSideProps of reset-password.tsx and send-reset-password.tsx (and the now-unused IS_CLOUD import), so the password-reset flow works on self-hosted, not only on cloud.

Closes #4664

Why

The reset email is already sent on-prem (sendResetPassword / emailAndPassword are not cloud-gated), but the page the link points to redirected to /, making the whole flow a dead end for self-hosted users.

Safety

  • /reset-password still redirects to / when no token query param is present (guard kept). The new-password submit calls better-auth resetPassword, which validates the token and its expiry server-side — no new server surface is exposed.
  • /send-reset-password is a public "enter email" form; submit calls the existing requestPasswordReset (no account-existence disclosure).
  • No user data is rendered on either page; only client-route reachability changes.

Notes

Admins who haven't configured SMTP simply won't receive emails (unchanged); those who have now get a working end-to-end reset.

Remove the IS_CLOUD guard in getServerSideProps of the reset-password and
send-reset-password pages (and the now-unused IS_CLOUD import) so the
password-reset flow works on self-hosted, not only on cloud.

The reset email is already sent on-prem (emailAndPassword/sendResetPassword
are not cloud-gated), but the page the link points to redirected to "/",
making the flow a dead end. The token guard on /reset-password is kept and
the token is validated server-side by better-auth.
@nizepart nizepart requested a review from Siumauricio as a code owner June 18, 2026 15:37
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-hosted: password reset is unusable — /reset-password redirects to / even with a valid token

1 participant