Skip to content

Commit 0e68876

Browse files
committed
doc(sample) update sample to use new exchangeToken type
1 parent 40e7cb4 commit 0e68876

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sample/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,17 @@ const disabledFunctions = () => {
263263

264264
const validateToken = async () => {
265265
try {
266-
const accessToken = await mtLinkSdk.exchangeToken();
267-
elements.accessTokenLabel.innerText = `Your access token is ${accessToken}.`;
266+
const token = await mtLinkSdk.exchangeToken();
267+
elements.accessTokenLabel.innerText = `Your access token is ${token.access_token}.`;
268268
const authHeaders = new Headers({
269269
method: 'GET',
270-
Authorization: `Bearer ${accessToken}`
270+
Authorization: `Bearer ${token.access_token}`
271271
});
272272
const response = await fetch('https://myaccount-staging.getmoneytree.com/oauth/token/info.json', {
273273
headers: authHeaders
274274
});
275275
const data: ITokenInfo = await response.json();
276-
elements.accessTokenLabel.innerText = `Your access token is ${accessToken}
276+
elements.accessTokenLabel.innerText = `Your access token is ${token.access_token}
277277
It was generated for the app: ${data.aud.name}.
278278
It will expire on ${new Date(data.exp * 1000)}.
279279
It allows you to: ${data.scopes.join(', ')}

0 commit comments

Comments
 (0)