huskar_api/models/auth/user.py
def parse_username_in_token(cls, secret_key, token, raises=False):
        """Parses the token and returns the username inside it.

        :param str secret_key: The secret key for HMAC signature of JWT.
        :param str token: The token value.
        :param bool raises: ``True`` if you want to raise exceptions while
                            token is invalid or expired.
        :returns: The username string or ``None``.
        """
        try:
            res = _load_token(secret_key, token, raises)
            if res is None:
                res = _load_fallback_token(token)
            return res
        except Exception:  # pragma: no cover
            # TODO: Deprecate this after lockdown
            res = _load_fallback_token(token)
            if res is None:
                raise
            return res
Parses the token and returns the username inside it.

        :param str secret_key: The secret key for HMAC signature of JWT.
        :param str token: The token value.
        :param bool raises: ``True`` if you want to raise exceptions while
                            token is invalid or expired.
        :returns: The username string or ``None``.
        
Parses the token and returns the username inside it.
Parses the token and returns the username inside it .
def parse_username_in_token(cls, secret_key, token, raises=False):
        try:
            res = _load_token(secret_key, token, raises)
            if res is None:
                res = _load_fallback_token(token)
            return res
        except Exception:  
            res = _load_fallback_token(token)
            if res is None:
                raise
            return res
def parse_username_in_token ( cls , secret_key , token , raises = False ) : try : res = _load_token ( secret_key , token , raises ) if res is None : res = _load_fallback_token ( token ) return res except Exception : res = _load_fallback_token ( token ) if res is None : raise return res
Parses the token and returns the username inside it.
Parses the token and returns the username inside it .
"""Parses the token and returns the username inside it.

        :param str secret_key: The secret key for HMAC signature of JWT.
        :param str token: The token value.
        :param bool raises: ``True`` if you want to raise exceptions while
                            token is invalid or expired.
        :returns: The username string or ``None``.
        """ # pragma: no cover # TODO: Deprecate this after lockdown
The username string or ``None``.
The username string or ` ` None ` ` .
cls
secret_key
The secret key for HMAC signature of JWT.
The secret key for HMAC signature of JWT .
token
The token value.
The token value .
raises
``True`` if you want to raise exceptions while
token is invalid or expired.
` ` True ` ` if you want to raise exceptions while token is invalid or expired .