From fc8b3f132c5629f95df8d865f47961b2775277cd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 12 2018 14:17:00 +0000 Subject: Check if the user is authenticated in the UI before resetting the values Signed-off-by: Pierre-Yves Chibon --- 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: