Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async getPhotoForResource(resource: string, scopes: string[]): Promise {
try {
const blob = await this.client
.api(`${resource}/photo/$value`)
.version('beta')
.responseType(ResponseType.BLOB)
.middlewareOptions(prepScopes(...scopes))
.get();
return await this.blobToBase64(blob);
} catch (e) {
return null;
}
}
}