This commit is contained in:
clauspeterhuebner 2025-07-11 01:13:39 +02:00
parent 528d8163e7
commit 37dd27745a

View File

@ -43,12 +43,13 @@ export class AuthenticationResolver {
logger.removeContext('handshakeID')
throw new Error(errmsg)
}
const pubKeyComA = Buffer.from(args.publicKey)
logger.debug('pubKeyComA', pubKeyComA.toString('hex'))
const pubKeyComA = Buffer.from(args.publicKey, 'hex')
logger.debug('pubKeyComA', pubKeyComA)
logger.debug('args.publicKey', args.publicKey)
const fedComA = await DbFedCommunity.findOneByOrFail({ publicKey: pubKeyComA })
logger.debug('fedComA', new FederatedCommunityLoggingView(fedComA))
if (!openConnectionJwtPayload.url.startsWith(fedComA.endPoint)) {
// const requestingCom = await DbCommunity.findOneBy({ publicKey: Buffer.from(args.publicKey, 'hex') })
const fedComA = await DbFedCommunity.findOneBy({ publicKey: Buffer.from(args.publicKey, 'hex') })
logger.debug('fedComA', new FederatedCommunityLoggingView(fedComA!))
if (fedComA && !openConnectionJwtPayload.url.startsWith(fedComA.endPoint)) {
const errmsg = `invalid url of community with publicKey` + args.publicKey
logger.error(errmsg)
logger.removeContext('handshakeID')