Skip to content

Commit fda2d1b

Browse files
committed
fix: fix decoding base64 when authenticating
1 parent 371ee90 commit fda2d1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/src/core/usecases/auth/oidcClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ export class HttpOidcClient implements OidcClient {
135135

136136
const responseBody = await response.text();
137137

138-
const userInfoAsString = responseBody.startsWith("ey") ? atob(responseBody.split(".")[1]) : responseBody;
138+
const userInfoAsString = responseBody.startsWith("ey")
139+
? Buffer.from(responseBody.split(".")[1], "base64").toString("utf8")
140+
: responseBody;
139141

140142
return JSON.parse(userInfoAsString);
141143
}

0 commit comments

Comments
 (0)