hasTokenExpired static method
Implementation
static bool hasTokenExpired(String token, [DateTime? compareAgainst]) {
try {
Map<String, dynamic> parsed = _decodeToken(token);
num exp = parsed["exp"] * 1000;
DateTime expiresIn = DateTime.fromMillisecondsSinceEpoch(
exp.toInt(),
);
return expiresIn.isBefore(compareAgainst ?? DateTime.now());
} catch (e, s) {
debugPrint("$e\n$s");
return true;
}
}