switch back from findByOne to findOneByOrFail

This commit is contained in:
clauspeterhuebner 2025-07-11 18:20:48 +02:00
parent d991606d93
commit 9ae71f6a03

View File

@ -43,9 +43,9 @@ export class AuthenticationResolver {
logger.removeContext('handshakeID')
throw new Error(errmsg)
}
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 fedComA = await DbFedCommunity.findOneByOrFail({ publicKey: Buffer.from(args.publicKey, 'hex') })
logger.debug('fedComA', new FederatedCommunityLoggingView(fedComA))
if (!openConnectionJwtPayload.url.startsWith(fedComA.endPoint)) {
const errmsg = `invalid url of community with publicKey` + args.publicKey
logger.error(errmsg)
logger.removeContext('handshakeID')