fix login
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
Repository,
|
||||
CreateDateColumn,
|
||||
Column,
|
||||
BeforeInsert,
|
||||
} from 'typeorm';
|
||||
import { User } from './user.entity';
|
||||
import { Injectable } from '@nestjs/common';
|
||||
@@ -25,6 +26,11 @@ export class SessionKey {
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
@BeforeInsert()
|
||||
setPWRevision() {
|
||||
this.pwRevision = this.user.pwRevision;
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -81,7 +81,6 @@ export class UsersService {
|
||||
|
||||
const s = this.sessionRepo.create({
|
||||
user,
|
||||
pwRevision: user.pwRevision,
|
||||
});
|
||||
const session = await this.sessionRepo.save(s);
|
||||
this.activityRepo.logLogin();
|
||||
|
||||
Reference in New Issue
Block a user