text: """
      JSON Web Tokens service.
  """
  
  # JWT libraries.
  import jwt
  
  # Base JWT algorithm, not required to be changed by you,
  # may be changed to RS256 later....
  JWT_ALGORITHM = "HS256"
  
  
  def decode(token: str, secret: str) -> tuple[bool, bool, str]:
      """ Returns is given token valid and its payload. """
      token_payload = jwt.decode(token, secret, algorithms=JWT_ALGORITHM)
      return token_payload