fetchUserInfo function
Future<LogtoUserInfoResponse>
fetchUserInfo(
{ - required Client httpClient,
- required String userInfoEndpoint,
- required String accessToken,
})
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);
}