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") {
await sendInviteEmailCode({
serviceUrl,
userId,
urlTemplate:
`${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 {
await sendEmailCode({
serviceUrl,
userId,
urlTemplate:
`${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 = {
serviceUrl: string;
type SendEmailCommand = {
userId: 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({
serviceUrl: command.serviceUrl,
serviceUrl,
userId: command.userId,
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({
serviceUrl: command.serviceUrl,
serviceUrl,
userId: command.userId,
urlTemplate: command.urlTemplate,
});