mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-25 08:23:21 +00:00
cleanup fcn
This commit is contained in:
@@ -48,7 +48,6 @@ const passwordAttemptsHandler = (error: ConnectError) => {
|
|||||||
|
|
||||||
export async function createSessionAndUpdateCookie(
|
export async function createSessionAndUpdateCookie(
|
||||||
checks: Checks,
|
checks: Checks,
|
||||||
challenges: RequestChallenges | undefined,
|
|
||||||
requestId: string | undefined,
|
requestId: string | undefined,
|
||||||
lifetime?: Duration,
|
lifetime?: Duration,
|
||||||
): Promise<Session> {
|
): Promise<Session> {
|
||||||
@@ -57,9 +56,7 @@ export async function createSessionAndUpdateCookie(
|
|||||||
|
|
||||||
const createdSession = await createSessionFromChecks({
|
const createdSession = await createSessionFromChecks({
|
||||||
serviceUrl,
|
serviceUrl,
|
||||||
|
|
||||||
checks,
|
checks,
|
||||||
challenges,
|
|
||||||
lifetime,
|
lifetime,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -241,7 +241,6 @@ export async function sendLoginname(command: SendLoginnameCommand) {
|
|||||||
|
|
||||||
const session = await createSessionAndUpdateCookie(
|
const session = await createSessionAndUpdateCookie(
|
||||||
checks,
|
checks,
|
||||||
undefined,
|
|
||||||
command.requestId,
|
command.requestId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -127,7 +127,6 @@ export async function sendPassword(command: UpdateSessionCommand) {
|
|||||||
try {
|
try {
|
||||||
session = await createSessionAndUpdateCookie(
|
session = await createSessionAndUpdateCookie(
|
||||||
checks,
|
checks,
|
||||||
undefined,
|
|
||||||
command.requestId,
|
command.requestId,
|
||||||
loginSettings?.passwordCheckLifetime,
|
loginSettings?.passwordCheckLifetime,
|
||||||
);
|
);
|
||||||
|
@@ -71,7 +71,6 @@ export async function registerUser(command: RegisterUserCommand) {
|
|||||||
|
|
||||||
const session = await createSessionAndUpdateCookie(
|
const session = await createSessionAndUpdateCookie(
|
||||||
checks,
|
checks,
|
||||||
undefined,
|
|
||||||
command.requestId,
|
command.requestId,
|
||||||
command.password ? loginSettings?.passwordCheckLifetime : undefined,
|
command.password ? loginSettings?.passwordCheckLifetime : undefined,
|
||||||
);
|
);
|
||||||
|
@@ -155,11 +155,7 @@ export async function sendVerification(command: VerifyUserByEmailCommand) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
session = await createSessionAndUpdateCookie(
|
session = await createSessionAndUpdateCookie(checks, command.requestId);
|
||||||
checks,
|
|
||||||
undefined,
|
|
||||||
command.requestId,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!session?.factors?.user?.id) {
|
if (!session?.factors?.user?.id) {
|
||||||
@@ -368,11 +364,7 @@ export async function sendVerificationRedirectWithoutCheck(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
session = await createSessionAndUpdateCookie(
|
session = await createSessionAndUpdateCookie(checks, command.requestId);
|
||||||
checks,
|
|
||||||
undefined,
|
|
||||||
command.requestId,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!session?.factors?.user?.id) {
|
if (!session?.factors?.user?.id) {
|
||||||
|
@@ -237,18 +237,16 @@ export async function getPasswordComplexitySettings({
|
|||||||
export async function createSessionFromChecks({
|
export async function createSessionFromChecks({
|
||||||
serviceUrl,
|
serviceUrl,
|
||||||
checks,
|
checks,
|
||||||
challenges,
|
|
||||||
lifetime,
|
lifetime,
|
||||||
}: {
|
}: {
|
||||||
serviceUrl: string;
|
serviceUrl: string;
|
||||||
checks: Checks;
|
checks: Checks;
|
||||||
challenges: RequestChallenges | undefined;
|
|
||||||
lifetime?: Duration;
|
lifetime?: Duration;
|
||||||
}) {
|
}) {
|
||||||
const sessionService: Client<typeof SessionService> =
|
const sessionService: Client<typeof SessionService> =
|
||||||
await createServiceForHost(SessionService, serviceUrl);
|
await createServiceForHost(SessionService, serviceUrl);
|
||||||
|
|
||||||
return sessionService.createSession({ checks, challenges, lifetime }, {});
|
return sessionService.createSession({ checks, lifetime }, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function createSessionForUserIdAndIdpIntent({
|
export async function createSessionForUserIdAndIdpIntent({
|
||||||
|
Reference in New Issue
Block a user