feat: major code refactor, add login and register endpoints with swagger
All checks were successful
Update changelog / changelog (push) Successful in 27s
All checks were successful
Update changelog / changelog (push) Successful in 27s
This commit is contained in:
@@ -1,30 +1,35 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from "typeorm"
|
||||
import { Link } from "./Link"
|
||||
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm'
|
||||
import { Link } from './Link'
|
||||
|
||||
@Entity("users")
|
||||
export class User {
|
||||
|
||||
// Unique user id.
|
||||
@PrimaryGeneratedColumn()
|
||||
id: number
|
||||
id: number | undefined; // Is this a good idea?
|
||||
|
||||
// User name, must be unique.
|
||||
@Column({ unique: true })
|
||||
name: string
|
||||
name: string;
|
||||
|
||||
// Salted password hash.
|
||||
@Column()
|
||||
passwordHash: string
|
||||
passwordHash: string;
|
||||
|
||||
// Used to tell, whether password hash should
|
||||
// be recalculated (salted) on next login.
|
||||
@Column()
|
||||
dirtyPasswordHashBit: boolean;
|
||||
|
||||
// User role:
|
||||
// - 0 - means unprivileged user,
|
||||
// - 1 - means administrative user.
|
||||
@Column()
|
||||
role: number
|
||||
role: number;
|
||||
|
||||
// Account creation date as a Unix timestamp.
|
||||
@Column('bigint')
|
||||
createdAt: number
|
||||
createdAt: number;
|
||||
|
||||
// List of shortened URLs which belong to the user.
|
||||
@OneToMany(() => Link, (link) => link.author)
|
||||
|
||||
Reference in New Issue
Block a user