auth: hash auth token

Since the auth token will be stored in hashed form in the db, we need to hash each provided auth token in order to search in the db for them.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-01-17 15:27:13 +01:00
parent cbf6ac912a
commit a4522d7230

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'; import { Column, CreateDateColumn, Entity, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
import { User } from './user.entity'; import { User } from './user.entity';
import { Type } from 'class-transformer'; import { Type } from 'class-transformer';
@ -19,8 +19,7 @@ export class AuthToken {
@Column() @Column()
identifier: string; identifier: string;
@Type(() => Date) @CreateDateColumn()
@Column('text')
createdAt: Date; createdAt: Date;
@Column() @Column()