isTokenExpired property
Checks if _token
is expired.
Implementation
Future<bool> get isTokenExpired async {
final response = await _client.post(
Uri.https(
'eclass.$instituteId.gr',
'/modules/mobile/mlogin.php',
),
body: {
'token': _token ?? '',
},
);
if (response.statusCode != 200) {
throw Exception('Failed to login.');
}
return response.body == 'EXPIRED';
}