Skip to content

Commit 043d53b

Browse files
committed
fix(google): patch auth library to return correct data
1 parent ac249f5 commit 043d53b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

patches/google-auth-library#9.1.0.patch

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ Index: \google-auth-library\build\src\auth\oauth2client.js
22
===================================================================
33
--- \google-auth-library\build\src\auth\oauth2client.js
44
+++ \google-auth-library\build\src\auth\oauth2client.js
5+
@@ -191,9 +191,9 @@
6+
e.message = JSON.stringify(e.response.data);
7+
}
8+
throw e;
9+
}
10+
- const tokens = res.data;
11+
+ const tokens = JSON.parse(res.data);
12+
// TODO: de-duplicate this code from a few spots
13+
if (res.data && res.data.expires_in) {
14+
tokens.expiry_date = new Date().getTime() + res.data.expires_in * 1000;
15+
delete tokens.expires_in;
516
@@ -731,9 +731,9 @@
617
OAuth2Client.GOOGLE_OAUTH2_AUTH_BASE_URL_ = 'https://accounts.google.com/o/oauth2/v2/auth';
718
/**

0 commit comments

Comments
 (0)