chore: 2fa added
This commit is contained in:
@@ -8,18 +8,6 @@ import { Domain } from "../../domains/entities/domain.entity";
|
||||
import { Template } from "../../templates/entities/template.entity";
|
||||
import { UserRepository } from "../repositories/user.repository";
|
||||
|
||||
export interface WebPushSubscriptionData {
|
||||
endpoint: string;
|
||||
keys: {
|
||||
p256dh: string;
|
||||
auth: string;
|
||||
};
|
||||
deviceType?: string;
|
||||
deviceName?: string;
|
||||
registeredAt?: Date;
|
||||
updatedAt?: Date;
|
||||
}
|
||||
|
||||
@Entity({ repository: () => UserRepository })
|
||||
@Unique({ properties: ["userName", "domain"], name: "unique_user_name_domain", options: { where: "deleted_at is null" } })
|
||||
export class User extends BaseEntity {
|
||||
@@ -63,15 +51,12 @@ export class User extends BaseEntity {
|
||||
@Property({ default: true, nullable: false })
|
||||
isActive: boolean & Opt;
|
||||
|
||||
// Push notification fields - now stores web push subscription objects
|
||||
@Property({ type: "json", nullable: true })
|
||||
pushTokens?: WebPushSubscriptionData[];
|
||||
|
||||
@Property({ type: "boolean", default: true })
|
||||
pushNotificationsEnabled: boolean & Opt;
|
||||
// Two-Factor Authentication fields
|
||||
@Property({ type: "boolean", default: false })
|
||||
is2FAEnabled: boolean & Opt;
|
||||
|
||||
@Property({ type: "timestamptz", nullable: true })
|
||||
lastPushNotificationAt?: Date;
|
||||
twoFactorEnabledAt?: Date;
|
||||
|
||||
//=========================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user