Пример #1
0
def guest():
    token = _get_token()

    # Public resources do not require a token.
    if not token:
        return True

    # But if there is a token, it should be valid.
    return token_api.is_valid(token)
Пример #2
0
def authenticated():
    token = _get_token()

    return token_api.is_valid(token)