From ead9e9a949dabbd517443e7180951311dbe47f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D1=80=D0=B0=D0=BF=D0=B5=D0=B7=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 18 Jun 2026 18:36:21 +0300 Subject: [PATCH] fix(auth): allow password reset on self-hosted instances 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. --- apps/dokploy/pages/reset-password.tsx | 9 --------- apps/dokploy/pages/send-reset-password.tsx | 10 ---------- 2 files changed, 19 deletions(-) diff --git a/apps/dokploy/pages/reset-password.tsx b/apps/dokploy/pages/reset-password.tsx index eff2389791..8eede6e942 100644 --- a/apps/dokploy/pages/reset-password.tsx +++ b/apps/dokploy/pages/reset-password.tsx @@ -1,4 +1,3 @@ -import { IS_CLOUD } from "@dokploy/server"; import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema"; import type { GetServerSidePropsContext } from "next"; import Link from "next/link"; @@ -187,14 +186,6 @@ Home.getLayout = (page: ReactElement) => { return {page}; }; export async function getServerSideProps(context: GetServerSidePropsContext) { - if (!IS_CLOUD) { - return { - redirect: { - permanent: false, - destination: "/", - }, - }; - } const { token } = context.query; if (typeof token !== "string") { diff --git a/apps/dokploy/pages/send-reset-password.tsx b/apps/dokploy/pages/send-reset-password.tsx index 63154d0501..ec300fbbf2 100644 --- a/apps/dokploy/pages/send-reset-password.tsx +++ b/apps/dokploy/pages/send-reset-password.tsx @@ -1,4 +1,3 @@ -import { IS_CLOUD } from "@dokploy/server"; import { standardSchemaResolver as zodResolver } from "@hookform/resolvers/standard-schema"; import type { GetServerSidePropsContext } from "next"; import Link from "next/link"; @@ -165,15 +164,6 @@ Home.getLayout = (page: ReactElement) => { return {page}; }; export async function getServerSideProps(_context: GetServerSidePropsContext) { - if (!IS_CLOUD) { - return { - redirect: { - permanent: false, - destination: "/", - }, - }; - } - return { props: {}, };