import base64
import json


def decode_token(tokenstr: str) -> dict:
    """Return a token dictionary from the string representation of the token.

    :param tokenstr:  The string representation of the token.
    :return: The token dictionary.
    """
    value = base64.b64decode(tokenstr)
    token = json.loads(value)
    return token