File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -449,22 +449,20 @@ export class UserService {
449
449
try {
450
450
this . validateEmail ( email . toLowerCase ( ) ) ;
451
451
const userData = await this . userRepository . checkUserExist ( email . toLowerCase ( ) ) ;
452
- const userSessionDetails = await this . userRepository . fetchUserSessions ( userData ?. id ) ;
453
- if ( Number ( process . env . SESSIONS_LIMIT ) <= userSessionDetails ?. length ) {
454
- throw new BadRequestException ( ResponseMessages . user . error . sessionLimitReached ) ;
455
- }
456
-
457
452
if ( ! userData ) {
458
453
throw new NotFoundException ( ResponseMessages . user . error . notFound ) ;
459
454
}
460
-
461
455
if ( userData && ! userData . isEmailVerified ) {
462
456
throw new BadRequestException ( ResponseMessages . user . error . verifyMail ) ;
463
457
}
464
458
465
459
if ( true === isPasskey && false === userData ?. isFidoVerified ) {
466
460
throw new UnauthorizedException ( ResponseMessages . user . error . registerFido ) ;
467
461
}
462
+ const userSessionDetails = await this . userRepository . fetchUserSessions ( userData ?. id ) ;
463
+ if ( Number ( process . env . SESSIONS_LIMIT ) <= userSessionDetails ?. length ) {
464
+ throw new BadRequestException ( ResponseMessages . user . error . sessionLimitReached ) ;
465
+ }
468
466
let tokenDetails ;
469
467
if ( true === isPasskey && userData ?. username && true === userData ?. isFidoVerified ) {
470
468
const getUserDetails = await this . userRepository . getUserDetails ( userData . email . toLowerCase ( ) ) ;
You can’t perform that action at this time.
0 commit comments