import base64


def decode_token(token):
    """
    Decode a jwt into readable format.

    :param token:
    :return: A decoded jwt, or None if its not a JWT
    """
    if token and len(token.split('.')) == 3:
        header = token.split('.')[0]
        header += '=' * (4 - len(header) % 4)

        payload = token.split('.')[1]
        payload += '=' * (4 - len(payload) % 4)

        return base64.b64decode(header), base64.b64decode(payload)

    # It's not a JWT
    return None