getUserData method
Get the user data from the access token.
Implementation
Future<Map<String, dynamic>?> getUserData() async {
try {
response = await http.get(
Uri.parse(userDataUrl),
headers: {
'Accept': 'application/json',
'Authorization': "Bearer $accessToken",
},
);
var userData = jsonDecode(response.body);
return userData;
} catch (e) {
return null;
}
}