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)
def authenticated(): token = _get_token() return token_api.is_valid(token)