Skip to content

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

Merged
AminDhouib merged 3 commits into
canaryfrom
port/upr-4665
Jul 16, 2026
Merged

fix(auth): allow password reset on self-hosted (remove IS_CLOUD gate on reset pages)#112
AminDhouib merged 3 commits into
canaryfrom
port/upr-4665

Conversation

@AminDhouib

Copy link
Copy Markdown
Member

Summary

Removes the !IS_CLOUD redirect in getServerSideProps of reset-password.tsx and send-reset-password.tsx (plus the now-unused IS_CLOUD import), so the password-reset flow is reachable on self-hosted instances, not only on cloud. The reset email is already sent on-prem (sendResetPassword / emailAndPassword are not cloud-gated); previously the emailed link landed on a page that redirected to /, making the flow a dead end.

Ports Dokploy#4665 by @nizepart (closed unmerged upstream 2026-06-30)

Addresses Dokploy#4664 (verified below)

Security review

  • The reset token is delivered only through the emailed link (sendResetPassword -> sendEmail); requestPasswordReset never returns it to the browser, so making the page reachable does not expose a token.
  • /reset-password keeps its token-presence guard (redirects to / when no token query param); resetPassword (better-auth) validates the token and its expiry server-side, so there is no open reset.
  • /send-reset-password is the existing public "enter email" form (requestPasswordReset), which does not disclose account existence.
  • Instances without SMTP configured fail to send the email server-side inside sendResetPassword (pre-existing behavior, unchanged by this PR); no token is exposed in that path.

Verification

  • Fork v0.29.11 still carries the !IS_CLOUD gate in both reset pages (reset-password.tsx, send-reset-password.tsx), confirming the flow is a dead end on self-hosted.
  • pnpm --filter=dokploy run typecheck passes.

Трапезин Андрей Александрович and others added 3 commits July 12, 2026 21:28
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.

(cherry picked from commit ead9e9a)
# Conflicts:
#	apps/dokploy/pages/send-reset-password.tsx
@AminDhouib
AminDhouib merged commit eec2529 into canary Jul 16, 2026
3 checks passed
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.

1 participant