get_token_validity function

Future<DateTime> get_token_validity(
  1. String token
)

Implementation

Future<DateTime> get_token_validity(String token) async {
  var client = Dio();
  var response = await client.get(
    'https://graph.microsoft.com/v1.0/me',
    options: Options(headers: {'Authorization': 'Bearer $token'}),
  );
  var validity = DateTime.now().add(Duration(seconds: 3599));
  return validity;
}