github mapping, signup

This commit is contained in:
peintnermax
2023-07-28 15:23:17 +02:00
parent c17a2bad87
commit 83000f1700
9 changed files with 595 additions and 55 deletions

View File

@@ -27,6 +27,8 @@ import {
ListAuthenticationMethodTypesResponse,
StartIdentityProviderFlowRequest,
StartIdentityProviderFlowResponse,
RetrieveIdentityProviderInformationRequest,
RetrieveIdentityProviderInformationResponse,
} from "@zitadel/server";
export const zitadelConfig: ZitadelServerOptions = {
@@ -175,14 +177,14 @@ export async function addHumanUser(
server: ZitadelServer,
{ email, firstName, lastName, password }: AddHumanUserData
): Promise<string> {
const mgmt = user.getUser(server);
const userService = user.getUser(server);
const payload = {
email: { email },
username: email,
profile: { firstName, lastName },
};
return mgmt
return userService
.addHumanUser(
password
? {
@@ -210,6 +212,18 @@ export async function startIdentityProviderFlow(
});
}
export async function retrieveIdentityProviderInformation(
server: ZitadelServer,
{ intentId, token }: RetrieveIdentityProviderInformationRequest
): Promise<RetrieveIdentityProviderInformationResponse> {
const userService = user.getUser(server);
return userService.retrieveIdentityProviderInformation({
intentId,
token,
});
}
export async function verifyEmail(
server: ZitadelServer,
userId: string,