fetchUserInfo function
Fetch user info using the access token.
Implementation
Future<LogtoUserInfoResponse> fetchUserInfo(
{required http.Client httpClient,
required String userInfoEndpoint,
required String accessToken}) async {
final response = await httpClient.post(Uri.parse(userInfoEndpoint),
headers: {'Authorization': 'Bearer $accessToken'});
var body = httpResponseHandler(response);
return LogtoUserInfoResponse.fromJson(body);
}