mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-14 14:53:10 +00:00
urlTemplate
This commit is contained in:
@@ -141,7 +141,7 @@
|
||||
"info": "The user will receive an email with further instructions.",
|
||||
"submit": "Continue",
|
||||
"success": {
|
||||
"title": "Invite User",
|
||||
"title": "User invited",
|
||||
"description": "The email has successfully been sent.",
|
||||
"verified": "The user has been invited and has already verified his email.",
|
||||
"notVerifiedYet": "The user has been invited. They will receive an email with further instructions.",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { addHumanUser, createInviteCode } from "@/lib/zitadel";
|
||||
import { Factors } from "@zitadel/proto/zitadel/session/v2/session_pb";
|
||||
import { headers } from "next/headers";
|
||||
|
||||
type InviteUserCommand = {
|
||||
email: string;
|
||||
@@ -19,6 +20,8 @@ export type RegisterUserResponse = {
|
||||
};
|
||||
|
||||
export async function inviteUser(command: InviteUserCommand) {
|
||||
const host = headers().get("host");
|
||||
|
||||
const human = await addHumanUser({
|
||||
email: command.email,
|
||||
firstName: command.firstName,
|
||||
@@ -31,7 +34,7 @@ export async function inviteUser(command: InviteUserCommand) {
|
||||
return { error: "Could not create user" };
|
||||
}
|
||||
|
||||
const codeResponse = await createInviteCode(human.userId);
|
||||
const codeResponse = await createInviteCode(human.userId, host);
|
||||
|
||||
if (!codeResponse || !human) {
|
||||
return { error: "Could not create invite code" };
|
||||
|
||||
@@ -312,7 +312,7 @@ export async function resendInviteCode(userId: string) {
|
||||
return userService.resendInviteCode({ userId }, {});
|
||||
}
|
||||
|
||||
export async function createInviteCode(userId: string, host?: string) {
|
||||
export async function createInviteCode(userId: string, host: string | null) {
|
||||
let medium = create(SendInviteCodeSchema, {
|
||||
applicationName: "Typescript Login",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user