@classmethod<EOL><INDENT>def from_jwt(cls, jwt, key='<STR_LIT>'):<DEDENT>
verify = True if key else False<EOL>try:<EOL><INDENT>payload = jwt_lib.decode(bytes(jwt), key, options={<EOL>'<STR_LIT>': verify,<EOL>'<STR_LIT>': True,<EOL>'<STR_LIT>': True,<EOL>})<EOL>headers = jwt_lib.get_unverified_header(jwt)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise JwtDecodeError(getattr(e, '<STR_LIT:message>', str(e)))<EOL><DEDENT>return cls._from_jwt(headers, payload, key)<EOL>
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.