fix invite resend

This commit is contained in:
Max Peintner
2025-05-23 12:05:06 +02:00
parent 0c6972d068
commit 446768b5e4

View File

@@ -1,11 +1,11 @@
"use server";
import {
createInviteCode,
getLoginSettings,
getSession,
getUserByID,
listAuthenticationMethodTypes,
resendInviteCode,
verifyEmail,
verifyInviteCode,
verifyTOTPRegistration,
@@ -275,14 +275,10 @@ export async function resendVerification(command: resendVerifyEmailCommand) {
const basePath = process.env.NEXT_PUBLIC_BASE_PATH ?? "";
// create a new invite whenever the resend is called
return command.isInvite
? createInviteCode({
? resendInviteCode({
serviceUrl,
userId: command.userId,
urlTemplate:
`${host.includes("localhost") ? "http://" : "https://"}${host}${basePath}/verify?code={{.Code}}&userId={{.UserID}}&organization={{.OrgID}}&invite=true` +
(command.requestId ? `&requestId=${command.requestId}` : ""),
}) //resendInviteCode({ serviceUrl, userId: command.userId })
: sendEmailCode({
userId: command.userId,