mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
26 lines
504 B
TypeScript
26 lines
504 B
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
ManyToOne,
|
|
PrimaryGeneratedColumn,
|
|
} from "typeorm";
|
|
import { User } from "../users/user.entity";
|
|
|
|
@Entity()
|
|
export class AuthSession {
|
|
@PrimaryGeneratedColumn("uuid")
|
|
id: string;
|
|
|
|
@ManyToOne(() => User, { eager: true })
|
|
user: User;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
|
|
@Column({ type: "timestamp", default: () => "CURRENT_TIMESTAMP" })
|
|
lastUsedAt: Date;
|
|
|
|
@Column({ type: "timestamp", nullable: true })
|
|
revokedAt: Date | null;
|
|
}
|