mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 17:23:19 +00:00
find sessions for loginHint, send to select account
This commit is contained in:
@@ -9,9 +9,11 @@ import { XCircleIcon } from "@heroicons/react/24/outline";
|
||||
export default function SessionItem({
|
||||
session,
|
||||
reload,
|
||||
authRequestId,
|
||||
}: {
|
||||
session: Session;
|
||||
reload: () => void;
|
||||
authRequestId?: string;
|
||||
}) {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
|
||||
@@ -52,10 +54,18 @@ export default function SessionItem({
|
||||
loginName: session.factors?.user?.loginName as string,
|
||||
})
|
||||
: `/loginname?` +
|
||||
new URLSearchParams({
|
||||
loginName: session.factors?.user?.loginName as string,
|
||||
submit: "true",
|
||||
})
|
||||
new URLSearchParams(
|
||||
authRequestId
|
||||
? {
|
||||
loginName: session.factors?.user?.loginName as string,
|
||||
submit: "true",
|
||||
authRequestId,
|
||||
}
|
||||
: {
|
||||
loginName: session.factors?.user?.loginName as string,
|
||||
submit: "true",
|
||||
}
|
||||
)
|
||||
}
|
||||
className="group flex flex-row items-center bg-background-light-400 dark:bg-background-dark-400 border border-divider-light hover:shadow-lg dark:hover:bg-white/10 py-2 px-4 rounded-md transition-all"
|
||||
>
|
||||
|
||||
@@ -7,9 +7,10 @@ import { useEffect, useState } from "react";
|
||||
|
||||
type Props = {
|
||||
sessions: Session[];
|
||||
authRequestId?: string;
|
||||
};
|
||||
|
||||
export default function SessionsList({ sessions }: Props) {
|
||||
export default function SessionsList({ sessions, authRequestId }: Props) {
|
||||
const [list, setList] = useState<Session[]>(sessions);
|
||||
return sessions ? (
|
||||
<div className="flex flex-col space-y-2">
|
||||
@@ -19,6 +20,7 @@ export default function SessionsList({ sessions }: Props) {
|
||||
return (
|
||||
<SessionItem
|
||||
session={session}
|
||||
authRequestId={authRequestId}
|
||||
reload={() => {
|
||||
setList(list.filter((s) => s.id !== session.id));
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user