This commit is contained in:
Max Peintner
2024-11-22 11:27:37 +01:00
parent 837cd4f674
commit fe615a220a
23 changed files with 74 additions and 116 deletions

View File

@@ -20,11 +20,9 @@ async function loadSessions() {
}
}
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "accounts" });

View File

@@ -15,11 +15,9 @@ import {
import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "authenticator" });

View File

@@ -12,12 +12,10 @@ const PROVIDER_NAME_MAPPING: {
[IdentityProviderType.AZURE_AD]: "Microsoft",
};
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<{ provider: string }>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<{ provider: string }>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "idp" });

View File

@@ -29,12 +29,10 @@ async function loginFailed(branding?: BrandingSettings) {
</DynamicTheme>
);
}
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<{ provider: string }>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<{ provider: string }>;
}) {
const params = await props.params;
const searchParams = await props.searchParams;
const locale = getLocale();
@@ -138,12 +136,12 @@ export default async function Page(
if (idpLink) {
return (
// TODO: possibily login user now
(<DynamicTheme branding={branding}>
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">
<h1>{t("linkingSuccess.title")}</h1>
<div>{t("linkingSuccess.description")}</div>
</div>
</DynamicTheme>)
</DynamicTheme>
);
}
}

View File

@@ -12,11 +12,9 @@ function getIdentityProviders(orgId?: string) {
});
}
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "idp" });

View File

@@ -9,11 +9,9 @@ import {
} from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "invite" });

View File

@@ -7,11 +7,9 @@ import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb";
import { getLocale, getTranslations } from "next-intl/server";
import Link from "next/link";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "invite" });

View File

@@ -19,11 +19,9 @@ function getIdentityProviders(orgId?: string) {
});
}
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "loginname" });

View File

@@ -12,11 +12,9 @@ import {
} from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "mfa" });

View File

@@ -32,11 +32,9 @@ function isSessionValid(session: Partial<Session>): {
return { valid, verifiedAt };
}
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "mfa" });

View File

@@ -6,12 +6,10 @@ import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings, getLoginSettings } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const params = await props.params;
const searchParams = await props.searchParams;
const locale = getLocale();

View File

@@ -17,12 +17,10 @@ import { getLocale, getTranslations } from "next-intl/server";
import Link from "next/link";
import { redirect } from "next/navigation";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
params: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const params = await props.params;
const searchParams = await props.searchParams;
const locale = getLocale();

View File

@@ -11,11 +11,9 @@ import {
} from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "passkey" });

View File

@@ -6,11 +6,9 @@ import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "passkey" });

View File

@@ -10,11 +10,9 @@ import {
} from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "password" });

View File

@@ -12,11 +12,9 @@ import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { PasskeysType } from "@zitadel/proto/zitadel/settings/v2/login_settings_pb";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "password" });

View File

@@ -13,11 +13,9 @@ import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb";
import { HumanUser, User } from "@zitadel/proto/zitadel/user/v2/user_pb";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "password" });

View File

@@ -10,11 +10,9 @@ import {
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "register" });

View File

@@ -10,11 +10,9 @@ import {
import { Organization } from "@zitadel/proto/zitadel/org/v2/org_pb";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "register" });

View File

@@ -7,11 +7,9 @@ import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings, getSession } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "u2f" });

View File

@@ -6,11 +6,9 @@ import { loadMostRecentSession } from "@/lib/session";
import { getBrandingSettings } from "@/lib/zitadel";
import { getLocale, getTranslations } from "next-intl/server";
export default async function Page(
props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}
) {
export default async function Page(props: {
searchParams: Promise<Record<string | number | symbol, string | undefined>>;
}) {
const searchParams = await props.searchParams;
const locale = getLocale();
const t = await getTranslations({ locale, namespace: "u2f" });

View File

@@ -61,7 +61,7 @@ export default async function Page(props: { searchParams: Promise<any> }) {
}
return (
(<DynamicTheme branding={branding}>
<DynamicTheme branding={branding}>
<div className="flex flex-col items-center space-y-4">
<h1>{t("verify.title")}</h1>
<p className="ztdl-p mb-6 block">{t("verify.description")}</p>
@@ -93,14 +93,14 @@ export default async function Page(props: { searchParams: Promise<any> }) {
/>
) : (
// check if auth methods are set
(<VerifyForm
<VerifyForm
userId={userId}
code={code}
isInvite={invite === "true"}
params={params}
/>)
/>
)}
</div>
</DynamicTheme>)
</DynamicTheme>
);
}

View File

@@ -21,7 +21,7 @@ export type Cookie = {
type SessionCookie<T> = Cookie & T;
function setSessionHttpOnlyCookie<T>(sessions: SessionCookie<T>[]) {
const cookiesList = (cookies() as unknown as UnsafeUnwrappedCookies);
const cookiesList = cookies() as unknown as UnsafeUnwrappedCookies;
return cookiesList.set({
name: "sessions",