import { Column, Entity, OneToOne, Unique } from 'typeorm'; import { User } from '..'; import { AbstractEntity } from '../abstract'; import { PersistedPassword } from '../types'; @Entity({ name: 'password_authentication_strategy' }) @Unique(['email']) export default class PasswordAuthenticationStrategy extends AbstractEntity { @OneToOne(() => User, (user) => user.passwordAuth) user!: User; @Column({ type: 'varchar', nullable: false, }) email!: string; @Column(() => PersistedPassword, { prefix: 'password', }) passwordData!: PersistedPassword; @Column({ type: 'boolean', nullable: false, default: false, }) isVerified!: boolean; }