mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 13:35:07 +00:00
loadMostRecentSession
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import { getBrandingSettings, sessionService } from "@/lib/zitadel";
|
||||
import { getBrandingSettings } from "@/lib/zitadel";
|
||||
import Alert from "@/ui/Alert";
|
||||
import DynamicTheme from "@/ui/DynamicTheme";
|
||||
import LoginOTP from "@/ui/LoginOTP";
|
||||
@@ -17,7 +17,7 @@ export default async function Page({
|
||||
|
||||
const { method } = params;
|
||||
|
||||
const session = await loadMostRecentSession(sessionService, {
|
||||
const session = await loadMostRecentSession({
|
||||
loginName,
|
||||
organization,
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
addOTPSMS,
|
||||
getBrandingSettings,
|
||||
registerTOTP,
|
||||
sessionService,
|
||||
} from "@/lib/zitadel";
|
||||
import Alert from "@/ui/Alert";
|
||||
import BackButton from "@/ui/BackButton";
|
||||
@@ -27,7 +26,7 @@ export default async function Page({
|
||||
const { method } = params;
|
||||
|
||||
const branding = await getBrandingSettings(organization);
|
||||
const session = await loadMostRecentSession(sessionService, {
|
||||
const session = await loadMostRecentSession({
|
||||
loginName,
|
||||
organization,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import { getBrandingSettings, sessionService } from "@/lib/zitadel";
|
||||
import { getBrandingSettings } from "@/lib/zitadel";
|
||||
import Alert, { AlertType } from "@/ui/Alert";
|
||||
import DynamicTheme from "@/ui/DynamicTheme";
|
||||
import RegisterPasskey from "@/ui/RegisterPasskey";
|
||||
@@ -13,7 +13,7 @@ export default async function Page({
|
||||
const { loginName, promptPasswordless, organization, authRequestId } =
|
||||
searchParams;
|
||||
|
||||
const session = await loadMostRecentSession(sessionService, {
|
||||
const session = await loadMostRecentSession({
|
||||
loginName,
|
||||
organization,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getSessionCookieById } from "@/lib/cookies";
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import { getBrandingSettings, getSession, sessionService } from "@/lib/zitadel";
|
||||
import { getBrandingSettings, getSession } from "@/lib/zitadel";
|
||||
import Alert from "@/ui/Alert";
|
||||
import DynamicTheme from "@/ui/DynamicTheme";
|
||||
import LoginPasskey from "@/ui/LoginPasskey";
|
||||
@@ -20,7 +20,7 @@ export default async function Page({
|
||||
|
||||
const sessionFactors = sessionId
|
||||
? await loadSessionById(sessionId, organization)
|
||||
: await loadMostRecentSession(sessionService, { loginName, organization });
|
||||
: await loadMostRecentSession({ loginName, organization });
|
||||
|
||||
async function loadSessionById(sessionId: string, organization?: string) {
|
||||
const recent = await getSessionCookieById({ sessionId, organization });
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import {
|
||||
getBrandingSettings,
|
||||
getLoginSettings,
|
||||
sessionService,
|
||||
} from "@/lib/zitadel";
|
||||
import { getBrandingSettings, getLoginSettings } from "@/lib/zitadel";
|
||||
import Alert from "@/ui/Alert";
|
||||
import DynamicTheme from "@/ui/DynamicTheme";
|
||||
import PasswordForm from "@/ui/PasswordForm";
|
||||
@@ -17,7 +13,7 @@ export default async function Page({
|
||||
const { loginName, organization, promptPasswordless, authRequestId, alt } =
|
||||
searchParams;
|
||||
|
||||
const sessionFactors = await loadMostRecentSession(sessionService, {
|
||||
const sessionFactors = await loadMostRecentSession({
|
||||
loginName,
|
||||
organization,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getSessionCookieById } from "@/lib/cookies";
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import { getBrandingSettings, getSession, sessionService } from "@/lib/zitadel";
|
||||
import { getBrandingSettings, getSession } from "@/lib/zitadel";
|
||||
import Alert from "@/ui/Alert";
|
||||
import DynamicTheme from "@/ui/DynamicTheme";
|
||||
import LoginPasskey from "@/ui/LoginPasskey";
|
||||
@@ -17,7 +17,7 @@ export default async function Page({
|
||||
|
||||
const sessionFactors = sessionId
|
||||
? await loadSessionById(sessionId, organization)
|
||||
: await loadMostRecentSession(sessionService, { loginName, organization });
|
||||
: await loadMostRecentSession({ loginName, organization });
|
||||
|
||||
async function loadSessionById(sessionId: string, organization?: string) {
|
||||
const recent = await getSessionCookieById({ sessionId, organization });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { loadMostRecentSession } from "@/lib/session";
|
||||
import { getBrandingSettings, sessionService } from "@/lib/zitadel";
|
||||
import { getBrandingSettings } from "@/lib/zitadel";
|
||||
import Alert from "@/ui/Alert";
|
||||
import DynamicTheme from "@/ui/DynamicTheme";
|
||||
import RegisterU2F from "@/ui/RegisterU2F";
|
||||
@@ -12,7 +12,7 @@ export default async function Page({
|
||||
}) {
|
||||
const { loginName, organization, authRequestId } = searchParams;
|
||||
|
||||
const sessionFactors = await loadMostRecentSession(sessionService, {
|
||||
const sessionFactors = await loadMostRecentSession({
|
||||
loginName,
|
||||
organization,
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use server";
|
||||
|
||||
import { loadMostRecentSession } from "./session";
|
||||
import { sessionService, verifyTOTPRegistration } from "./zitadel";
|
||||
import { verifyTOTPRegistration } from "./zitadel";
|
||||
|
||||
export async function verifyTOTP(
|
||||
code: string,
|
||||
loginName?: string,
|
||||
organization?: string,
|
||||
) {
|
||||
return loadMostRecentSession(sessionService, {
|
||||
return loadMostRecentSession({
|
||||
loginName,
|
||||
organization,
|
||||
}).then((session) => {
|
||||
|
||||
Reference in New Issue
Block a user