Skip to content

Commit 4ddd5fb

Browse files
committed
fix issue with token validation
1 parent 6965dc6 commit 4ddd5fb

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/nylas-connect/src/connect-client.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -719,13 +719,9 @@ export class NylasConnect {
719719
}
720720

721721
try {
722-
const response = await fetch(`${this.config.apiUrl}/connect/tokeninfo`, {
723-
method: "POST",
724-
headers: {
725-
"Content-Type": "application/x-www-form-urlencoded",
726-
},
727-
body: `access_token=${encodeURIComponent(accessToken)}`,
728-
});
722+
const response = await fetch(
723+
`${this.config.apiUrl}/connect/tokeninfo?access_token=${encodeURIComponent(accessToken)}`,
724+
);
729725

730726
const data = await response.json();
731727
const isValid = !!(response.ok && data?.data);

0 commit comments

Comments
 (0)