From 1a31c67ca195748e6a7147484ff2c520237612d7 Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:36:23 +0200 Subject: [PATCH 1/2] fix invite url --- .../components/invite-user-form/invite-user-form.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx b/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx index f1875cd73e00b..518a2ec26c9f7 100644 --- a/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx +++ b/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx @@ -40,6 +40,8 @@ const InviteUserSchema = zod.object({ const PAGE_SIZE = 10 const PREFIX = "usr_invite" +const INVITE_URL = `${backendUrl}${__BASE__ === "/" ? "" : __BASE__}/invite?token=` + export const InviteUserForm = () => { const { t } = useTranslation() @@ -206,7 +208,7 @@ const InviteActions = ({ invite }: { invite: InviteDTO }) => { } const handleCopyInviteLink = () => { - const inviteUrl = `${backendUrl}/app/invite?token=${invite.token}` + const inviteUrl = `${INVITE_URL}${invite.token}` copy(inviteUrl) } From 6bf3e2bcb6ac87416edf56d7b1c61c3632154cb9 Mon Sep 17 00:00:00 2001 From: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:41:01 +0200 Subject: [PATCH 2/2] use window location instead of backend url --- .../components/invite-user-form/invite-user-form.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx b/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx index 518a2ec26c9f7..731482be9d529 100644 --- a/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx +++ b/packages/admin-next/dashboard/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx @@ -31,7 +31,6 @@ import { } from "../../../../../hooks/api/invites" import { useUserInviteTableQuery } from "../../../../../hooks/table/query/use-user-invite-table-query" import { useDataTable } from "../../../../../hooks/use-data-table" -import { backendUrl } from "../../../../../lib/client" import { isFetchError } from "../../../../../lib/is-fetch-error.ts" const InviteUserSchema = zod.object({ @@ -40,7 +39,7 @@ const InviteUserSchema = zod.object({ const PAGE_SIZE = 10 const PREFIX = "usr_invite" -const INVITE_URL = `${backendUrl}${__BASE__ === "/" ? "" : __BASE__}/invite?token=` +const INVITE_URL = `${window.location.origin}${__BASE__ === "/" ? "" : __BASE__}/invite?token=` export const InviteUserForm = () => {