Skip to content

Commit 7600413

Browse files
authored
Merge pull request #1412 from credebl/develop
Sync develop with qa
2 parents f08f732 + a6b69fd commit 7600413

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

apps/agent-service/src/agent-service.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class AgentServiceService {
105105
const agentDetails = await this.agentServiceRepository.getAgentDetailsByOrgId(orgId);
106106
return agentDetails;
107107
} catch (error) {
108-
this.logger.error(`in getAgentDetails::: ${JSON.stringify(error)}`);
108+
this.logger.error(`in getAgentDetails ::: ${JSON.stringify(error)}`);
109109
throw new RpcException(error.response ?? error);
110110
}
111111
}
@@ -1568,7 +1568,7 @@ export class AgentServiceService {
15681568
description: ResponseMessages.errorMessages.notFound
15691569
});
15701570
}
1571-
const url = getAgentUrl(orgAgentDetails.agentEndPoint, CommonConstants.SIGN_DATA_FROM_AGENT);
1571+
const url = await getAgentUrl(orgAgentDetails.agentEndPoint, CommonConstants.SIGN_DATA_FROM_AGENT);
15721572

15731573
const { dataTypeToSign, credentialPayload, rawPayload, storeCredential } = data;
15741574

@@ -1628,7 +1628,7 @@ export class AgentServiceService {
16281628
description: ResponseMessages.errorMessages.notFound
16291629
});
16301630
}
1631-
const url = getAgentUrl(orgAgentDetails.agentEndPoint, CommonConstants.VERIFY_SIGNED_DATA_FROM_AGENT);
1631+
const url = await getAgentUrl(orgAgentDetails.agentEndPoint, CommonConstants.VERIFY_SIGNED_DATA_FROM_AGENT);
16321632

16331633
// Invoke an API request from the agent to assess its current status
16341634
const signedDataFromAgent = await this.commonService

apps/user/src/user.service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,22 +449,20 @@ export class UserService {
449449
try {
450450
this.validateEmail(email.toLowerCase());
451451
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-
457452
if (!userData) {
458453
throw new NotFoundException(ResponseMessages.user.error.notFound);
459454
}
460-
461455
if (userData && !userData.isEmailVerified) {
462456
throw new BadRequestException(ResponseMessages.user.error.verifyMail);
463457
}
464458

465459
if (true === isPasskey && false === userData?.isFidoVerified) {
466460
throw new UnauthorizedException(ResponseMessages.user.error.registerFido);
467461
}
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+
}
468466
let tokenDetails;
469467
if (true === isPasskey && userData?.username && true === userData?.isFidoVerified) {
470468
const getUserDetails = await this.userRepository.getUserDetails(userData.email.toLowerCase());

libs/common/src/common.constant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export enum CommonConstants {
111111
URL_AGENT_GET_ENDPOINT = '/agent',
112112

113113
// sign data from agent
114-
URL_AGENT_SIGN_DATA = '/agent/credential/sign/#',
114+
URL_AGENT_SIGN_DATA = '/agent/credential/sign',
115115
URL_AGENT_VERIFY_SIGNED_DATA = '/agent/credential/verify',
116116

117117
// CREATE KEYS

0 commit comments

Comments
 (0)