File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,6 @@ POST {{apiUrl}}/auth/password/reset/email
6767
6868{
6969 "email" : " {{$dotenv REST_USER_LOGIN}}" ,
70- "token" : " f5792b25-e9ce-44e4-a34d-a9382257b086 " ,
70+ "token" : " b70e0419-9839-4a6e-a799-8580e929e5a9 " ,
7171 "password" : " {{$dotenv REST_USER_PASSWORD}}"
7272}
Original file line number Diff line number Diff line change 11import { inject as Inject , injectable as Injectable } from 'tsyringe' ;
2- import { LessThanOrEqual } from 'typeorm' ;
2+ import { MoreThanOrEqual } from 'typeorm' ;
33
4+ import { SortBy } from '@common/enums' ;
45import { DateUtil } from '@common/utils' ;
56import { ValidatorServiceCore } from '@core/service' ;
67import type { FullUser } from '@modules/user' ;
@@ -27,7 +28,7 @@ export class OtpValidatorService
2728 where : {
2829 ...query ,
2930 userId : user . id ,
30- expiredAt : LessThanOrEqual ( new Date ( ) ) ,
31+ expiredAt : MoreThanOrEqual ( new Date ( ) ) ,
3132 isVerified : false ,
3233 } ,
3334 } ) ;
@@ -44,8 +45,9 @@ export class OtpValidatorService
4445 where : {
4546 ...query ,
4647 userId : user . id ,
47- createdAt : LessThanOrEqual ( createdAt ) ,
48+ createdAt : MoreThanOrEqual ( createdAt ) ,
4849 } ,
50+ order : { createdAt : SortBy . DESC } ,
4951 } ) ;
5052
5153 if ( otp ) {
@@ -58,7 +60,7 @@ export class OtpValidatorService
5860 private calculateResendTime ( ) : Date {
5961 return DateUtil . addMillisecondToDate (
6062 new Date ( ) ,
61- DateUtil . parseStringToMs ( DELAY_FOR_RESEND ) ,
63+ - DateUtil . parseStringToMs ( DELAY_FOR_RESEND ) ,
6264 ) ;
6365 }
6466}
You can’t perform that action at this time.
0 commit comments