loginname, password org context

This commit is contained in:
peintnermax
2024-03-25 13:39:23 +01:00
parent f6e9f69859
commit a9d0752b5f
8 changed files with 182 additions and 46 deletions

View File

@@ -9,11 +9,15 @@ export default async function Page({
}: {
searchParams: Record<string | number | symbol, string | undefined>;
}) {
const { loginName, promptPasswordless, authRequestId, alt } = searchParams;
const sessionFactors = await loadSession(loginName);
const { loginName, organization, promptPasswordless, authRequestId, alt } =
searchParams;
const sessionFactors = await loadSession(loginName, organization);
async function loadSession(loginName?: string) {
const recent = await getMostRecentCookieWithLoginname(loginName);
async function loadSession(loginName?: string, organization?: string) {
const recent = await getMostRecentCookieWithLoginname(
loginName,
organization
);
return getSession(server, recent.id, recent.token).then((response) => {
if (response?.session) {