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
Following along with this https://ably.com/tutorials/token-authentication and the code doesn't work. I assumed it was something I had copied incorrectly. Got the source from here and tried to run it, same errors.
When entering the username and hitting enter, server.py produces a 500 error and client also produces an error.
This is because the authentication needs to be awaited for the token to be returned in time to return to the client.
Server error:
Traceback (most recent call last): File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 280, in process return self.handle() File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 271, in handle return self._delegate(fn, self.fvars, args) File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 502, in _delegate return handle_class(f) File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 495, in handle_class return tocall(*args) File "/Projects/ably/tutorials/server.py", line 34, in GET return json.dumps(client.auth.create_token_request(token_params).to_dict()) AttributeError: 'coroutine' object has no attribute 'to_dict'
Client error:
09:38:33.437 Ably: Auth.requestToken(): token request signing call returned error; err = [t: Malformed response body from server: Unexpected token '<', "<!DOCTYPE "... is not valid JSON; statusCode=400] r @ ably.min-1.js:24
Following along with this https://ably.com/tutorials/token-authentication and the code doesn't work. I assumed it was something I had copied incorrectly. Got the source from here and tried to run it, same errors.
When entering the username and hitting enter, server.py produces a 500 error and client also produces an error.
This is because the authentication needs to be awaited for the token to be returned in time to return to the client.
Server error:
Traceback (most recent call last): File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 280, in process return self.handle() File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 271, in handle return self._delegate(fn, self.fvars, args) File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 502, in _delegate return handle_class(f) File "/Projects/ably/tutorials/venv/lib/python3.10/site-packages/web/application.py", line 495, in handle_class return tocall(*args) File "/Projects/ably/tutorials/server.py", line 34, in GET return json.dumps(client.auth.create_token_request(token_params).to_dict()) AttributeError: 'coroutine' object has no attribute 'to_dict'
Client error:
09:38:33.437 Ably: Auth.requestToken(): token request signing call returned error; err = [t: Malformed response body from server: Unexpected token '<', "<!DOCTYPE "... is not valid JSON; statusCode=400] r @ ably.min-1.js:24
Environment details:
The text was updated successfully, but these errors were encountered: