Generate PNI key on standalone registration

This commit is contained in:
Fedor Indutny 2021-12-03 03:06:32 +01:00 committed by GitHub
parent 13de35bea2
commit ca1aef660f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 101 additions and 81 deletions

View file

@ -765,7 +765,7 @@ export type WebAPIType = {
newPassword: string,
registrationId: number,
deviceName?: string | null,
options?: { accessKey?: Uint8Array; uuid?: UUIDStringType }
options?: { accessKey?: Uint8Array }
) => Promise<ConfirmCodeResultType>;
createGroup: (
group: Proto.IGroup,
@ -1634,7 +1634,7 @@ export function initialize({
newPassword: string,
registrationId: number,
deviceName?: string | null,
options: { accessKey?: Uint8Array; uuid?: UUIDStringType } = {}
options: { accessKey?: Uint8Array } = {}
) {
const capabilities: CapabilitiesUploadType = {
announcementGroup: true,
@ -1644,7 +1644,7 @@ export function initialize({
changeNumber: true,
};
const { accessKey, uuid } = options;
const { accessKey } = options;
const jsonData = {
capabilities,
fetchesMessages: true,
@ -1678,7 +1678,7 @@ export function initialize({
})) as ConfirmCodeResultType;
// Set final REST credentials to let `registerKeys` succeed.
username = `${uuid || response.uuid || number}.${response.deviceId || 1}`;
username = `${response.uuid || number}.${response.deviceId || 1}`;
password = newPassword;
return response;