Request our PNI along with group credential fetch

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2022-07-25 13:27:53 -07:00 committed by GitHub
parent b99d401578
commit c396a4032b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -126,12 +126,6 @@ export async function maybeFetchNewCredentials(): Promise<void> {
return;
}
const pni = window.textsecure.storage.user.getUuid(UUIDKind.PNI)?.toString();
if (!pni) {
log.info(`${logId}: no PNI, returning early`);
return;
}
const previous: CredentialsDataType | undefined =
window.storage.get('groupCredentials');
const requestDates = getDatesForRequest(previous);
@ -151,6 +145,13 @@ export async function maybeFetchNewCredentials(): Promise<void> {
`${logId}: fetching credentials for ${startDayInMs} through ${endDayInMs}`
);
// TODO(indutny): In the future we'd like to avoid this extra call all the time
const { pni } = await server.whoami();
if (!pni) {
log.info(`${logId}: no PNI, returning early`);
return;
}
const serverPublicParamsBase64 = window.getServerPublicParams();
const clientZKAuthOperations = getClientZkAuthOperations(
serverPublicParamsBase64