mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 18:42:23 +00:00
move cookie utils to @zitadel/next package
This commit is contained in:
@@ -5,6 +5,7 @@ import RegisterPasskey from "@/ui/RegisterPasskey";
|
||||
import RegisterU2F from "@/ui/RegisterU2F";
|
||||
import UserAvatar from "@/ui/UserAvatar";
|
||||
import { getMostRecentCookieWithLoginname } from "@/utils/cookies";
|
||||
import { loadMostRecentSession } from "@zitadel/next";
|
||||
|
||||
export default async function Page({
|
||||
searchParams,
|
||||
@@ -13,19 +14,8 @@ export default async function Page({
|
||||
}) {
|
||||
const { loginName, organization, authRequestId } = searchParams;
|
||||
|
||||
const sessionFactors = await loadSession(loginName);
|
||||
const sessionFactors = await loadMostRecentSession(loginName, organization);
|
||||
|
||||
async function loadSession(loginName?: string) {
|
||||
const recent = await getMostRecentCookieWithLoginname(
|
||||
loginName,
|
||||
organization,
|
||||
);
|
||||
return getSession(recent.id, recent.token).then((response) => {
|
||||
if (response?.session) {
|
||||
return response.session;
|
||||
}
|
||||
});
|
||||
}
|
||||
const title = "Use your passkey to confirm it's really you";
|
||||
const description =
|
||||
"Your device will ask for your fingerprint, face, or screen lock";
|
||||
|
||||
Reference in New Issue
Block a user