Skip to content

Refresh Token setting doesn't work... #153

@GuyKh

Description

@GuyKh

Loading the same Refresh Token (from scratch) - doesn't seem to work

...
>>> ym.check_and_refresh_token()
Token(access_token='...', refresh_token='v1.MrzTbat22k_gUVui_6J3dLg7BDQErx1OdFPc6-9lRtc8h0-xxxxx', id_token=None, scope=None, valid_until=datetime.datetime(2025, 10, 6, 11, 14, 52, 622694, tzinfo=<UTC>), token_type='Bearer')

(closing python)

❯ python3
Python 3.13.3 (main, Aug 14 2025, 11:53:40) [GCC 14.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from yoto_api import YotoManager
>>> ym = YotoManager(client_id="...")
>>> ym.set_refresh_token('v1.MrzTbat22k_gUVui_6J3dLg7BDQErx1OdFPc6-9lRtc8h0-xxxxx')
>>> ym.check_and_refresh_token()
Traceback (most recent call last):
  File "<python-input-3>", line 1, in <module>
    ym.check_and_refresh_token()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/guyk/.local/lib/python3.13/site-packages/yoto_api/YotoManager.py", line 123, in check_and_refresh_token
    self.token = self.api.refresh_token(self.token)
                 ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/guyk/.local/lib/python3.13/site-packages/yoto_api/YotoAPI.py", line 42, in refresh_token
    raise AuthenticationError("Refresh token invalid")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions