mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 16:03:59 +01:00
Fix another edge case login loop
This commit is contained in:
@@ -99,10 +99,14 @@ class GazelleAPI(object):
|
|||||||
'password': self.password}
|
'password': self.password}
|
||||||
r = self.session.post(loginpage, data=data)
|
r = self.session.post(loginpage, data=data)
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
raise LoginException
|
raise LoginException("Login returned status code %s" % r.status_code)
|
||||||
accountinfo = self.request('index')
|
|
||||||
|
try:
|
||||||
|
accountinfo = self.request('index', autologin=False)
|
||||||
|
except RequestException as e:
|
||||||
|
raise LoginException("Login probably incorrect")
|
||||||
if not accountinfo or 'id' not in accountinfo:
|
if not accountinfo or 'id' not in accountinfo:
|
||||||
raise LoginException
|
raise LoginException("Login probably incorrect")
|
||||||
self.userid = accountinfo['id']
|
self.userid = accountinfo['id']
|
||||||
self.authkey = accountinfo['authkey']
|
self.authkey = accountinfo['authkey']
|
||||||
self.passkey = accountinfo['passkey']
|
self.passkey = accountinfo['passkey']
|
||||||
|
|||||||
Reference in New Issue
Block a user