It looks like you're encountering an issue with the @fusionauth fnaf/typescript-client library after upgrading to version 1.54.0. The error message indicates that the access token you're receiving does not include the openid scope, which is necessary for the retrieveUserInfoFromAccessToken function to work properly.
import { FusionAuthClient } from '@fusionauth/typescript-client';
const client = new FusionAuthClient(apiKey, fusionAuthUrl);
async function authenticateUser() {
const response = await client.exchangeOAuthCodeForAccessToken(clientId, clientSecret, redirectUri, code);
if (response.successResponse) {
const accessToken = response.successResponse.access_token;
const userInfo = await client.retrieveUserInfoFromAccessToken(accessToken);
console.log(userInfo);
} else {
console.error(response.errorResponse);
}
}