treat publicKey without hex

This commit is contained in:
Claus-Peter Huebner 2023-10-24 21:09:12 +02:00
parent 6ca275fa30
commit df34bf9b43
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ export async function startCommunityAuthentication(
// eslint-disable-next-line camelcase
if (client instanceof V1_0_AuthenticationClient) {
const args = new OpenConnectionArgs()
args.publicKey = homeCom.publicKey.toString('hex')
args.publicKey = homeCom.publicKey.toString()
// TODO encrypt url with foreignCom.publicKey and sign it with homeCom.privateKey
args.url = homeFedCom.endPoint.endsWith('/')
? homeFedCom.endPoint

View File

@ -22,7 +22,7 @@ export class AuthenticationResolver {
// first find with args.publicKey the community, which starts openConnection request
const requestedCom = await DbCommunity.findOneBy({
publicKey: Buffer.from(args.publicKey, 'hex'),
publicKey: Buffer.from(args.publicKey),
})
if (!requestedCom) {
throw new LogError(`unknown requesting community with publicKey`, args.publicKey)