mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-14 18:05:48 +00:00
changed date string to iso
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
import { SourceType } from '@app/common/constants/source-type.enum';
|
import { SourceType } from '@app/common/constants/source-type.enum';
|
||||||
import { Entity, Column, PrimaryColumn, Index } from 'typeorm';
|
import { Entity, Column, PrimaryColumn, Unique } from 'typeorm';
|
||||||
|
|
||||||
@Entity('device-status-log')
|
@Entity('device-status-log')
|
||||||
@Index('event_time_idx', ['eventTime'])
|
@Unique('event_time_idx', ['eventTime'])
|
||||||
export class DeviceStatusLogEntity {
|
export class DeviceStatusLogEntity {
|
||||||
@Column({ type: 'int', generated: true, unsigned: true })
|
@Column({ type: 'int', generated: true, unsigned: true })
|
||||||
id: number;
|
id: number;
|
||||||
|
@ -256,11 +256,13 @@ export class UserAuthService {
|
|||||||
throw new BadRequestException('You entered wrong otp');
|
throw new BadRequestException('You entered wrong otp');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (otp.expiryTime < new Date() || fromNewPassword) {
|
if (otp.expiryTime < new Date()) {
|
||||||
await this.otpRepository.delete(otp.uuid);
|
await this.otpRepository.delete(otp.uuid);
|
||||||
throw new BadRequestException('OTP expired');
|
throw new BadRequestException('OTP expired');
|
||||||
}
|
}
|
||||||
|
if (fromNewPassword) {
|
||||||
|
await this.otpRepository.delete(otp.uuid);
|
||||||
|
}
|
||||||
if (data.type == OtpType.VERIFICATION) {
|
if (data.type == OtpType.VERIFICATION) {
|
||||||
await this.userRepository.update(
|
await this.userRepository.update(
|
||||||
{ email: data.email },
|
{ email: data.email },
|
||||||
|
Reference in New Issue
Block a user