Fix account names to display UTF8 characters (#21070)

This commit is contained in:
Cheena Malhotra
2022-11-02 10:04:50 -07:00
committed by GitHub
parent 9693c2f466
commit b35942ad80

View File

@@ -642,7 +642,7 @@ export abstract class AzureAuth implements vscode.Disposable {
protected getTokenClaims(accessToken: string): TokenClaims { protected getTokenClaims(accessToken: string): TokenClaims {
try { try {
const split = accessToken.split('.'); const split = accessToken.split('.');
return JSON.parse(Buffer.from(split[1], 'base64').toString('binary')); return JSON.parse(Buffer.from(split[1], 'base64').toString('UTF8'));
} catch (ex) { } catch (ex) {
throw new Error('Unable to read token claims: ' + JSON.stringify(ex)); throw new Error('Unable to read token claims: ' + JSON.stringify(ex));
} }