cleanup fcn

This commit is contained in:
Max Peintner
2025-02-19 10:11:10 +01:00
parent 762993bd41
commit f2000e1302
6 changed files with 3 additions and 19 deletions

View File

@@ -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,
}); });

View File

@@ -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,
); );

View File

@@ -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,
); );

View File

@@ -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,
); );

View File

@@ -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) {

View File

@@ -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({