verifyJwt function
Implementation
dynamic verifyJwt(String token, String secret) {
if (token != "") {
try {
final jwt = JWT.verify(token, SecretKey(secret));
return jwt;
} on JWTExpiredError {
print('jwt expired');
} on JWTError catch (ex) {
return null;
print(ex.message); // ex: invalid signature
}
} else {
return null;
}
}