This commit is contained in:
Max Peintner
2025-05-26 16:26:23 +02:00
parent 5e573c8c9c
commit 5cfc458779
2 changed files with 11 additions and 8 deletions

View File

@@ -45,7 +45,6 @@ export default async function Page(props: { searchParams: Promise<any> }) {
if (invite === "true") { if (invite === "true") {
await sendInviteEmailCode({ await sendInviteEmailCode({
serviceUrl,
userId, userId,
urlTemplate: urlTemplate:
`${host.includes("localhost") ? "http://" : "https://"}${host}${basePath}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}&invite=true` + `${host.includes("localhost") ? "http://" : "https://"}${host}${basePath}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}&invite=true` +
@@ -56,7 +55,6 @@ export default async function Page(props: { searchParams: Promise<any> }) {
}); });
} else { } else {
await sendEmailCode({ await sendEmailCode({
serviceUrl,
userId, userId,
urlTemplate: urlTemplate:
`${host.includes("localhost") ? "http://" : "https://"}${host}${basePath}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}` + `${host.includes("localhost") ? "http://" : "https://"}${host}${basePath}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}` +

View File

@@ -301,23 +301,28 @@ export async function resendVerification(command: resendVerifyEmailCommand) {
}); });
} }
type sendEmailCommand = { type SendEmailCommand = {
serviceUrl: string;
userId: string; userId: string;
urlTemplate: string; urlTemplate: string;
}; };
export async function sendEmailCode(command: sendEmailCommand) { export async function sendEmailCode(command: SendEmailCommand) {
const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
return zitadelSendEmailCode({ return zitadelSendEmailCode({
serviceUrl: command.serviceUrl, serviceUrl,
userId: command.userId, userId: command.userId,
urlTemplate: command.urlTemplate, urlTemplate: command.urlTemplate,
}); });
} }
export async function sendInviteEmailCode(command: sendEmailCommand) { export async function sendInviteEmailCode(command: SendEmailCommand) {
const _headers = await headers();
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
return createInviteCode({ return createInviteCode({
serviceUrl: command.serviceUrl, serviceUrl,
userId: command.userId, userId: command.userId,
urlTemplate: command.urlTemplate, urlTemplate: command.urlTemplate,
}); });