Request our PNI along with group credential fetch
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
0e68db7ee9
commit
9fc1f2c0dc
|
@ -126,12 +126,6 @@ export async function maybeFetchNewCredentials(): Promise<void> {
|
||||||
return;
|
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 =
|
const previous: CredentialsDataType | undefined =
|
||||||
window.storage.get('groupCredentials');
|
window.storage.get('groupCredentials');
|
||||||
const requestDates = getDatesForRequest(previous);
|
const requestDates = getDatesForRequest(previous);
|
||||||
|
@ -151,6 +145,13 @@ export async function maybeFetchNewCredentials(): Promise<void> {
|
||||||
`${logId}: fetching credentials for ${startDayInMs} through ${endDayInMs}`
|
`${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 serverPublicParamsBase64 = window.getServerPublicParams();
|
||||||
const clientZKAuthOperations = getClientZkAuthOperations(
|
const clientZKAuthOperations = getClientZkAuthOperations(
|
||||||
serverPublicParamsBase64
|
serverPublicParamsBase64
|
||||||
|
|
Loading…
Reference in a new issue