mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-13 11:20:00 +00:00
postLogoutRedirectUri
This commit is contained in:
@@ -33,8 +33,8 @@ export default async function Page(props: {
|
||||
const locale = getLocale();
|
||||
const t = await getTranslations({ locale, namespace: "logout" });
|
||||
|
||||
const requestId = searchParams?.requestId;
|
||||
const organization = searchParams?.organization;
|
||||
const postLogoutRedirectUri = searchParams?.post_logout_redirect_uri;
|
||||
|
||||
const _headers = await headers();
|
||||
const { serviceUrl } = getServiceUrlFromHeaders(_headers);
|
||||
@@ -58,10 +58,6 @@ export default async function Page(props: {
|
||||
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (requestId) {
|
||||
params.append("requestId", requestId);
|
||||
}
|
||||
|
||||
if (organization) {
|
||||
params.append("organization", organization);
|
||||
}
|
||||
@@ -73,7 +69,10 @@ export default async function Page(props: {
|
||||
<p className="ztdl-p mb-6 block">{t("description")}</p>
|
||||
|
||||
<div className="flex flex-col w-full space-y-2">
|
||||
<SessionsClearList sessions={sessions} requestId={requestId} />
|
||||
<SessionsClearList
|
||||
sessions={sessions}
|
||||
postLogoutRedirectUri={postLogoutRedirectUri}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</DynamicTheme>
|
||||
|
@@ -13,11 +13,9 @@ import { isSessionValid } from "./session-item";
|
||||
export function SessionClearItem({
|
||||
session,
|
||||
reload,
|
||||
requestId,
|
||||
}: {
|
||||
session: Session;
|
||||
reload: () => void;
|
||||
requestId?: string;
|
||||
}) {
|
||||
const t = useTranslations("logout");
|
||||
|
||||
|
@@ -3,18 +3,21 @@
|
||||
import { timestampDate } from "@zitadel/client";
|
||||
import { Session } from "@zitadel/proto/zitadel/session/v2/session_pb";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { Alert, AlertType } from "./alert";
|
||||
import { SessionClearItem } from "./session-clear-item";
|
||||
|
||||
type Props = {
|
||||
sessions: Session[];
|
||||
requestId?: string;
|
||||
postLogoutRedirectUri?: string;
|
||||
};
|
||||
|
||||
export function SessionsClearList({ sessions, requestId }: Props) {
|
||||
export function SessionsClearList({ sessions, postLogoutRedirectUri }: Props) {
|
||||
const t = useTranslations("logout");
|
||||
const [list, setList] = useState<Session[]>(sessions);
|
||||
const router = useRouter();
|
||||
|
||||
return sessions ? (
|
||||
<div className="flex flex-col space-y-2">
|
||||
{list
|
||||
@@ -34,9 +37,11 @@ export function SessionsClearList({ sessions, requestId }: Props) {
|
||||
return (
|
||||
<SessionClearItem
|
||||
session={session}
|
||||
requestId={requestId}
|
||||
reload={() => {
|
||||
setList(list.filter((s) => s.id !== session.id));
|
||||
if (postLogoutRedirectUri) {
|
||||
router.push(postLogoutRedirectUri);
|
||||
}
|
||||
}}
|
||||
key={"session-" + index}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user