'Decode a JWT string into a Jwt object
:param str jwt: JWT string
:param Optional[str] key: key used to verify JWT signature, if not provided then validation
is skipped.
:raises JwtDecodeError if decoding JWT fails for any reason.
:return: A DecodedJwt object containing the jwt information.'

@classmethod
def from_jwt(cls, jwt, key=''):

    verify = (True if key else False)
    try:
        payload = jwt_lib.decode(bytes(jwt), key, verify=verify, options={'verify_signature': True, 'verify_exp': True, 'verify_nbf': True})
        headers = jwt_lib.get_unverified_header(jwt)
    except Exception as e:
        raise JwtDecodeError(getattr(e, 'message', str(e)))
    return cls._from_jwt(headers, payload, key)
