Commit 9f8d4df2 by Bertrand Marron

Handle json error in IONISx auth middleware

parent e3020973
...@@ -57,7 +57,10 @@ class PortalSynchronizerMiddleware(object): ...@@ -57,7 +57,10 @@ class PortalSynchronizerMiddleware(object):
log.warning(err) log.warning(err)
return return
body = r.json() try:
body = r.json()
except ValueError:
body = None
if r.status_code != 200: if r.status_code != 200:
if body and u'error' in body and u'redirectTo' in body[u'error']: if body and u'error' in body and u'redirectTo' in body[u'error']:
......
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