From d73d20e00afd3187a2dafa05f11624c3090b438e Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Wed, 25 Oct 2023 22:03:10 +0200 Subject: [PATCH] correct endpoint and api slicing from callback url --- .../src/graphql/api/1_0/resolver/AuthenticationResolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts b/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts index a6b1b5778..e526200d7 100644 --- a/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts +++ b/federation/src/graphql/api/1_0/resolver/AuthenticationResolver.ts @@ -45,8 +45,8 @@ export class AuthenticationResolver { ): Promise { logger.debug(`Authentication: openConnectionCallback() via apiVersion=1_0 ...`, args) // TODO decrypt args.url with homeCom.privateKey and verify signing with callbackFedCom.publicKey - const endPoint = args.url.slice(0, args.url.lastIndexOf('/')) - const apiVersion = args.url.slice(args.url.lastIndexOf('/'), args.url.length) + const endPoint = args.url.slice(0, args.url.lastIndexOf('/') + 1) + const apiVersion = args.url.slice(args.url.lastIndexOf('/') + 1, args.url.length) logger.debug(`Authentication: search fedCom per:`, endPoint, apiVersion) const callbackFedCom = await DbFedCommunity.findOneBy({ endPoint, apiVersion }) if (!callbackFedCom) {