decodeToken method

Map<String, dynamic>? decodeToken()

Implementation

Map<String, dynamic>? decodeToken() {
  // Check if the token is valid
  if (!Jwt.isExpired(token)) {
    // Decode the token
    Map<String, dynamic> decodedToken = Jwt.parseJwt(token);

    // Return the decoded token
    return decodedToken;
  } else {
    print("Token is expired.");
    return null;
  }
}