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 committed by David Mehren
parent 80c7ae2fa9
commit e04fcb9ee9
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -4,7 +4,7 @@
* 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 { Type } from 'class-transformer';
@ -19,8 +19,7 @@ export class AuthToken {
@Column()
identifier: string;
@Type(() => Date)
@Column('text')
@CreateDateColumn()
createdAt: Date;
@Column()