mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Merge pull request #24 from Portabase/feat/last-connected
feat : add last login date
This commit is contained in:
@@ -46,14 +46,14 @@ export function usersListColumns(): ColumnDef<User>[] {
|
|||||||
<TableCell
|
<TableCell
|
||||||
className="text-right text-muted-foreground">{formatLocalizedDate(row.original.createdAt)}</TableCell>
|
className="text-right text-muted-foreground">{formatLocalizedDate(row.original.createdAt)}</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
{/*{row.original.lastConnectedAt && (*/}
|
{row.original.lastConnectedAt && (
|
||||||
{/* <TableRow>*/}
|
<TableRow>
|
||||||
{/* <TableCell>Last connected</TableCell>*/}
|
<TableCell>Last connected</TableCell>
|
||||||
{/* <TableCell className="text-right text-muted-foreground">*/}
|
<TableCell className="text-right text-muted-foreground">
|
||||||
{/* {formatLocalizedDate(row.original.lastConnectedAt)} ({timeAgo(row.original.lastConnectedAt, locale)})*/}
|
{formatLocalizedDate(row.original.lastConnectedAt)} ({timeAgo(row.original.lastConnectedAt)})
|
||||||
{/* </TableCell>*/}
|
</TableCell>
|
||||||
{/* </TableRow>*/}
|
</TableRow>
|
||||||
{/*)}*/}
|
)}
|
||||||
{row.original.lastChangedPasswordAt && (
|
{row.original.lastChangedPasswordAt && (
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell>Last password change</TableCell>
|
<TableCell>Last password change</TableCell>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "user" ADD COLUMN "lastConnectedAt" timestamp;
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -141,6 +141,13 @@
|
|||||||
"when": 1767782077775,
|
"when": 1767782077775,
|
||||||
"tag": "0019_overjoyed_butterfly",
|
"tag": "0019_overjoyed_butterfly",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 20,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1768677251822,
|
||||||
|
"tag": "0020_low_giant_girl",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ import {boolean, integer, pgEnum, pgTable, text, timestamp, uuid} from "drizzle-
|
|||||||
import {createSelectSchema} from "drizzle-zod";
|
import {createSelectSchema} from "drizzle-zod";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
import {project} from "./06_project";
|
import {project} from "./06_project";
|
||||||
import {member, OrganizationMember} from "@/db/schema/04_member";
|
import {member} from "@/db/schema/04_member";
|
||||||
import {invitation} from "@/db/schema/05_invitation";
|
import {invitation} from "@/db/schema/05_invitation";
|
||||||
import {organization} from "@/db/schema/03_organization";
|
import {organization} from "@/db/schema/03_organization";
|
||||||
import {Account as BetterAuthAccount} from "better-auth";
|
import {Account as BetterAuthAccount} from "better-auth";
|
||||||
@@ -23,6 +23,7 @@ export const user = pgTable("user", {
|
|||||||
banned: boolean("banned"),
|
banned: boolean("banned"),
|
||||||
banReason: text("ban_reason"),
|
banReason: text("ban_reason"),
|
||||||
banExpires: timestamp("ban_expires"),
|
banExpires: timestamp("ban_expires"),
|
||||||
|
lastConnectedAt: timestamp(),
|
||||||
lastChangedPasswordAt: timestamp(),
|
lastChangedPasswordAt: timestamp(),
|
||||||
twoFactorEnabled: boolean("two_factor_enabled").default(false),
|
twoFactorEnabled: boolean("two_factor_enabled").default(false),
|
||||||
...timestamps
|
...timestamps
|
||||||
|
|||||||
Reference in New Issue
Block a user