Jason Rasmussen 7dc12dea1e
feat(web,server): link/unlink oauth account (#1154)
* feat(web,server): link/unlink oauth account

* chore: linting

* fix: broken oauth callback

* fix: user core bugs

* fix: tests

* fix: use user response

* chore: update docs

* feat: prevent the same oauth account from being linked twice

* chore: mock logger
2022-12-26 09:35:52 -06:00

45 lines
901 B
TypeScript

import { Column, CreateDateColumn, DeleteDateColumn, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { TagEntity } from './tag.entity';
@Entity('users')
export class UserEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@Column({ default: '' })
firstName!: string;
@Column({ default: '' })
lastName!: string;
@Column({ default: false })
isAdmin!: boolean;
@Column({ unique: true })
email!: string;
@Column({ default: '', select: false })
password?: string;
@Column({ default: '', select: false })
salt?: string;
@Column({ default: '' })
oauthId!: string;
@Column({ default: '' })
profileImagePath!: string;
@Column({ default: true })
shouldChangePassword!: boolean;
@CreateDateColumn()
createdAt!: string;
@DeleteDateColumn()
deletedAt?: Date;
@OneToMany(() => TagEntity, (tag) => tag.user)
tags!: TagEntity[];
}