Added database info for 2fa
This commit is contained in:
parent
e19fc42dac
commit
6ea51cf593
@ -13,6 +13,12 @@ export enum UserRole {
|
|||||||
DISABLED = 0
|
DISABLED = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum tfaTypes {
|
||||||
|
NONE = 0,
|
||||||
|
EMAIL = 1,
|
||||||
|
TOTP = 2
|
||||||
|
}
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
export class INode {
|
export class INode {
|
||||||
@PrimaryGeneratedColumn()
|
@PrimaryGeneratedColumn()
|
||||||
@ -59,6 +65,20 @@ export class User {
|
|||||||
rootId: number;
|
rootId: number;
|
||||||
@OneToOne(() => INode)
|
@OneToOne(() => INode)
|
||||||
root: Promise<INode>;
|
root: Promise<INode>;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
type: 'int',
|
||||||
|
default: tfaTypes.NONE,
|
||||||
|
transformer: {
|
||||||
|
from: (db: number): tfaTypes => db,
|
||||||
|
to: (type: tfaTypes): number => type
|
||||||
|
}
|
||||||
|
})
|
||||||
|
tfaType: tfaTypes;
|
||||||
|
|
||||||
|
// base32 string
|
||||||
|
@Column({ nullable: true })
|
||||||
|
tfaSecret: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Entity()
|
@Entity()
|
||||||
|
Loading…
Reference in New Issue
Block a user