Commit 0abfc5ac authored by Jérome Perrin's avatar Jérome Perrin

ERP5Security: fix a NameError in ERP5ExternalOauth2ExtractionPlugin

Happens when user has a __ac_google_hash cookie but token cannot be
found in token storage.
In that case login wouldn't be possible anyway, but we should not
pollute the logs.
parent 210a8e28
...@@ -142,6 +142,7 @@ class ERP5ExternalOauth2ExtractionPlugin: ...@@ -142,6 +142,7 @@ class ERP5ExternalOauth2ExtractionPlugin:
security.declarePrivate('extractCredentials') security.declarePrivate('extractCredentials')
def extractCredentials(self, request): def extractCredentials(self, request):
""" Extract Oauth2 credentials from the request header. """ """ Extract Oauth2 credentials from the request header. """
user_dict = {}
cookie_hash = request.get(self.cookie_name) cookie_hash = request.get(self.cookie_name)
if cookie_hash is not None: if cookie_hash is not None:
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment