We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88e4667 commit 7fc1f6aCopy full SHA for 7fc1f6a
extensions/microsoft-authentication/src/browser/buffer.ts
@@ -8,6 +8,10 @@ export function base64Encode(text: string): string {
8
}
9
10
export function base64Decode(text: string): string {
11
- const data = atob(text);
12
- return data;
+ // modification of https://stackoverflow.com/a/38552302
+ const replacedCharacters = text.replace(/-/g, '+').replace(/_/g, '/');
13
+ const decodedText = decodeURIComponent(atob(replacedCharacters).split('').map(function (c) {
14
+ return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
15
+ }).join(''));
16
+ return decodedText;
17
0 commit comments