You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the server sometimes presents redirects using status code 302, and sometimes using 307. The former is properly handled, the latter is not.
Tested on macOS 14.1.2 and Python 3.11, results in the following (shortened) debug output:
--------
return_url='https://singlekey-id.com/auth/connect/authorize/callback?client_id=[...]', <Response [302]>
return_url='https://singlekey-id.com/auth/login?returnUrl=%2Fauth%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3D[...]', <Response [302]>
return_url='https://singlekey-id.com/auth/en-gb/login?returnUrl=%2Fauth%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3D[...]', <Response [307]>
return_url='https://singlekey-id.com/auth/en-gb/login?returnUrl=%2Fauth%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3D[...]'
--------
Traceback (most recent call last):
File "/Users/jorrit/Documents/Projects/home_control_py/./hc-login", line 188, in <module>
code = query.get("code")[0]
~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable
The 302 redirect is properly handled, but the loop is ended upon a 307. This means the remaining code runs on the wrong URL, and crashes.
Changing line 168 seems to resolve this: if r.status_code != 302 and r_status_code != 307:
The text was updated successfully, but these errors were encountered:
It seems that the server sometimes presents redirects using status code
302
, and sometimes using307
. The former is properly handled, the latter is not.Tested on macOS 14.1.2 and Python 3.11, results in the following (shortened) debug output:
The
302
redirect is properly handled, but the loop is ended upon a307
. This means the remaining code runs on the wrong URL, and crashes.Changing line 168 seems to resolve this:
if r.status_code != 302 and r_status_code != 307:
The text was updated successfully, but these errors were encountered: