Open sylvestrevgen opened 4 years ago
I managed to solve this problem by modifying the code in App.js:
/* Once the viewer has initialized, it will ask us for a forge token so it can
access the specified document. */
async handleTokenRequested(onAccessToken) {
console.log('Token requested by the viewer.');
if (onAccessToken) {
let token = await getPublicToken();
if (token) {
onAccessToken(token.access_token, token.expires_in);
}
}
}
where getPublicToken()
is a function that retrieves the token.
When I replace static token data with fetch from API, in result token is undefined, but endpoint is correct. How I need to rewrite code example to use fetch token? Thanks.