mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-15 09:13:52 +00:00
provide host
This commit is contained in:
@@ -22,7 +22,12 @@ export type RegisterUserResponse = {
|
||||
export async function inviteUser(command: InviteUserCommand) {
|
||||
const host = (await headers()).get("host");
|
||||
|
||||
if (!host) {
|
||||
return { error: "Could not get domain" };
|
||||
}
|
||||
|
||||
const human = await addHumanUser({
|
||||
host,
|
||||
email: command.email,
|
||||
firstName: command.firstName,
|
||||
lastName: command.lastName,
|
||||
@@ -34,7 +39,7 @@ export async function inviteUser(command: InviteUserCommand) {
|
||||
return { error: "Could not create user" };
|
||||
}
|
||||
|
||||
const codeResponse = await createInviteCode(human.userId, host);
|
||||
const codeResponse = await createInviteCode({ userId: human.userId, host });
|
||||
|
||||
if (!codeResponse || !human) {
|
||||
return { error: "Could not create invite code" };
|
||||
|
||||
Reference in New Issue
Block a user