mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 05:20:43 +00:00
feat: added last login time
This commit is contained in:
+10
-5
@@ -293,7 +293,13 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
|
||||
{isPending && <TableSkeleton columns={3} innerKey="org-identities" />}
|
||||
{!isPending &&
|
||||
data?.identities?.map(
|
||||
({ identity: { id, name }, role, customRole, lastLoggedInAuthMethod }) => {
|
||||
({
|
||||
identity: { id, name },
|
||||
role,
|
||||
customRole,
|
||||
lastLoginAuthMethod,
|
||||
lastLoginTime
|
||||
}) => {
|
||||
return (
|
||||
<Tr
|
||||
className="h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"
|
||||
@@ -309,14 +315,13 @@ export const IdentityTable = ({ handlePopUpOpen }: Props) => {
|
||||
>
|
||||
<Td className="group">
|
||||
{name}
|
||||
{lastLoggedInAuthMethod && (
|
||||
{lastLoginAuthMethod && lastLoginTime && (
|
||||
<Tooltip
|
||||
className="min-w-52 max-w-96"
|
||||
content={
|
||||
<LastLoginSection
|
||||
lastLoggedInAuthMethod={
|
||||
identityAuthToNameMap[lastLoggedInAuthMethod]
|
||||
}
|
||||
lastLoginAuthMethod={identityAuthToNameMap[lastLoginAuthMethod]}
|
||||
lastLoginTime={lastLoginTime}
|
||||
/>
|
||||
}
|
||||
>
|
||||
|
||||
+7
-3
@@ -481,7 +481,8 @@ export const OrgMembersTable = ({
|
||||
id: orgMembershipId,
|
||||
status,
|
||||
isActive,
|
||||
lastLoggedInAuthMethod
|
||||
lastLoginAuthMethod,
|
||||
lastLoginTime
|
||||
}) => {
|
||||
const name =
|
||||
u && u.firstName ? `${u.firstName} ${u.lastName ?? ""}`.trim() : null;
|
||||
@@ -530,11 +531,14 @@ export const OrgMembersTable = ({
|
||||
</Tooltip>
|
||||
</Badge>
|
||||
)}
|
||||
{lastLoggedInAuthMethod && (
|
||||
{lastLoginAuthMethod && lastLoginTime && (
|
||||
<Tooltip
|
||||
className="min-w-52 max-w-96"
|
||||
content={
|
||||
<LastLoginSection lastLoggedInAuthMethod={lastLoggedInAuthMethod} />
|
||||
<LastLoginSection
|
||||
lastLoginAuthMethod={lastLoginAuthMethod}
|
||||
lastLoginTime={lastLoginTime}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<FontAwesomeIcon
|
||||
|
||||
+8
-1
@@ -24,6 +24,7 @@ import { OrgPermissionIdentityActions, OrgPermissionSubjects } from "@app/contex
|
||||
import { useTimedReset } from "@app/hooks";
|
||||
import { identityAuthToNameMap, useGetIdentityById } from "@app/hooks/api";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
import { format } from "date-fns";
|
||||
|
||||
type Props = {
|
||||
identityId: string;
|
||||
@@ -141,7 +142,13 @@ export const IdentityDetailsSection = ({ identityId, handlePopUpOpen }: Props) =
|
||||
<div className="mb-4">
|
||||
<p className="text-sm font-semibold text-mineshaft-300">Last Login Auth Method</p>
|
||||
<p className="text-sm text-mineshaft-300">
|
||||
{data.lastLoggedInAuthMethod ? identityAuthToNameMap[data.lastLoggedInAuthMethod] : "-"}
|
||||
{data.lastLoginAuthMethod ? identityAuthToNameMap[data.lastLoginAuthMethod] : "-"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<p className="text-sm font-semibold text-mineshaft-300">Last Login Time</p>
|
||||
<p className="text-sm text-mineshaft-300">
|
||||
{data.lastLoginTime ? format(data.lastLoginTime, "PPpp") : "-"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
|
||||
+10
-1
@@ -22,6 +22,7 @@ import { useFetchServerStatus, useGetOrgMembership, useGetOrgRoles } from "@app/
|
||||
import { OrgUser } from "@app/hooks/api/types";
|
||||
import { useResendOrgMemberInvitation } from "@app/hooks/api/users/mutation";
|
||||
import { UsePopUpState } from "@app/hooks/usePopUp";
|
||||
import { format } from "date-fns";
|
||||
|
||||
type Props = {
|
||||
membershipId: string;
|
||||
@@ -163,7 +164,15 @@ export const UserDetailsSection = ({ membershipId, handlePopUpOpen }: Props) =>
|
||||
<p className="text-sm font-semibold text-mineshaft-300">Last Login Auth Method</p>
|
||||
<div className="group flex align-top">
|
||||
<p className="break-all text-sm text-mineshaft-300">
|
||||
{membership.lastLoggedInAuthMethod || "-"}
|
||||
{membership.lastLoginAuthMethod || "-"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-4">
|
||||
<p className="text-sm font-semibold text-mineshaft-300">Last Login Time</p>
|
||||
<div className="group flex align-top">
|
||||
<p className="break-all text-sm text-mineshaft-300">
|
||||
{membership.lastLoginTime ? format(membership.lastLoginTime, "PPpp") : "-"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user