Added requestPairingCode method and handler

Fixed typo (trimUndefineds)
Added bytesToCrockford
Replaced advSecretKey with advKeyPair
Added pairingCode prop
Fixed formatting
Added pairing code example
This commit is contained in:
Alessandro Autiero
2023-07-16 18:35:46 +02:00
parent 0aaa0086f9
commit f498e1e56c
8 changed files with 293 additions and 30 deletions

View File

@@ -199,7 +199,7 @@ export const initAuthCreds = (): AuthenticationCreds => {
signedIdentityKey: identityKey,
signedPreKey: signedKeyPair(identityKey, 1),
registrationId: generateRegistrationId(),
advSecretKey: randomBytes(32).toString('base64'),
advKeyPair: Curve.generateKeyPair(),
processedHistoryMessages: [],
nextPreKeyId: 1,
firstUnuploadedPreKeyId: 1,
@@ -213,6 +213,7 @@ export const initAuthCreds = (): AuthenticationCreds => {
identityId: randomBytes(20),
registered: false,
backupToken: randomBytes(20),
registration: {} as never
registration: {} as never,
pairingCode: undefined
}
}