You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/channel-access-token/api/channelAccessTokenClient.ts
+24-8Lines changed: 24 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,9 @@ export class ChannelAccessTokenClient {
104
104
"/oauth2/v2.1/tokens/kid",
105
105
queryParams,
106
106
);
107
-
return{httpResponse: res,body: awaitres.json()};
107
+
consttext=awaitres.text();
108
+
constparsedBody=text ? JSON.parse(text) : null;
109
+
return{httpResponse: res,body: parsedBody};
108
110
}
109
111
/**
110
112
* Issue short-lived channel access token
@@ -157,7 +159,9 @@ export class ChannelAccessTokenClient {
157
159
"/v2/oauth/accessToken",
158
160
formParams,
159
161
);
160
-
return{httpResponse: res,body: awaitres.json()};
162
+
consttext=awaitres.text();
163
+
constparsedBody=text ? JSON.parse(text) : null;
164
+
return{httpResponse: res,body: parsedBody};
161
165
}
162
166
/**
163
167
* Issues a channel access token that allows you to specify a desired expiration date. This method lets you use JWT assertion for authentication.
@@ -210,7 +214,9 @@ export class ChannelAccessTokenClient {
210
214
"/oauth2/v2.1/token",
211
215
formParams,
212
216
);
213
-
return{httpResponse: res,body: awaitres.json()};
217
+
consttext=awaitres.text();
218
+
constparsedBody=text ? JSON.parse(text) : null;
219
+
return{httpResponse: res,body: parsedBody};
214
220
}
215
221
/**
216
222
* Issues a new stateless channel access token, which doesn\'t have max active token limit unlike the other token types. The newly issued token is only valid for 15 minutes but can not be revoked until it naturally expires.
@@ -272,7 +278,9 @@ export class ChannelAccessTokenClient {
0 commit comments