UNPKG

nestjs-auth-kit

Version:

A modular and flexible authentication kit for NestJS with JWT, social login, OTP, and password reset.

27 lines (19 loc) 496 B
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm'; import { OtpEntity } from './otp.entity'; @Entity() export class User { @PrimaryGeneratedColumn() id?: string; @Column() firstName?: string; @Column() lastName?: string; @Column() email?: string; @Column() password?: string; @Column('simple-array', { nullable: true }) roles?: string[]; @OneToMany(() => OtpEntity, (otp) => otp.user) otps?: OtpEntity[]; }