Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy connection invitation in multi-tenant agent #48

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/connection/src/connection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ export class ConnectionService {
const apiKey = platformConfig?.sgApiKey;

const createConnectionInvitation = await this._createConnectionInvitation(connectionPayload, url, apiKey);
const invitationObject = createConnectionInvitation.message.invitation['@id'];
const invitationObject = createConnectionInvitation?.message?.invitation['@id'];

const shortenedUrl = `${agentEndPoint}/url/${invitationObject}`;
let shortenedUrl;
if (agentDetails?.tenantId) {
shortenedUrl = `${agentEndPoint}/multi-tenancy/url/${agentDetails?.tenantId}/${invitationObject}`;
} else {
shortenedUrl = `${agentEndPoint}/url/${invitationObject}`;
}

const saveConnectionDetails = await this.connectionRepository.saveAgentConnectionInvitations(shortenedUrl, agentId, orgId);
return saveConnectionDetails;
Expand Down
2 changes: 1 addition & 1 deletion libs/common/src/common.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export enum CommonConstants {
// SHARED AGENT
URL_SHAGENT_CREATE_TENANT = '/multi-tenancy/create-tenant',
URL_SHAGENT_WITH_TENANT_AGENT = '/multi-tenancy/with-tenant-agent',
URL_SHAGENT_CREATE_INVITATION = '/multi-tenancy/create-invitation/#',
URL_SHAGENT_CREATE_INVITATION = '/multi-tenancy/create-legacy-invitation/#',
URL_SHAGENT_CREATE_OFFER = '/multi-tenancy/credentials/create-offer/#',
URL_SHAGENT_CREATE_OFFER_OUT_OF_BAND = '/multi-tenancy/credentials/create-offer-oob/#',
URL_SHAGENT_GET_CREDENTIALS = '/multi-tenancy/credentials/#',
Expand Down