diff --git a/pagure/api/__init__.py b/pagure/api/__init__.py index 0e822ee..af5de20 100644 --- a/pagure/api/__init__.py +++ b/pagure/api/__init__.py @@ -122,14 +122,14 @@ def check_api_acls(acls, optional=False): ''' Checks if the user provided an API token with its request and if this token allows the user to access the endpoint desired. ''' + if authenticated(): + return + flask.g.token = None - flask.g.user = None + flask.g.fas_user = None token = None token_str = None - if authenticated(): - return - if 'Authorization' in flask.request.headers: authorization = flask.request.headers['Authorization'] if 'token' in authorization: