subutux / rmapy

A unofficial python module for interacting with the Remarkable Cloud
http://rmapy.readthedocs.io/
MIT License
125 stars 48 forks source link

rmapy.is_auth() is False even immediately after registering the device - Config not persistent? #12

Closed micheledicosmo closed 3 years ago

micheledicosmo commented 3 years ago
rmapy = Client()                                                                                                                                             rmapy.register_device("ktgglqyq")
rmapy.renew_token()

The above code succeeds (API returns 200).

However, when I then do rmapy.is_auth() return False immediately after.

micheledicosmo commented 3 years ago

I noticed that the config is also not persistent: this might be the problem (i.e. the token is lost when I run the script again)

subutux commented 3 years ago

Hmm that’s strange. So no Config file is present @ $HOME/.rmapi?

Did you register your device first?

micheledicosmo commented 3 years ago

Ta. devicetoken is set, but usertoken is empty.

On Sat, 30 Jan 2021 at 14:43, Stijn Van Campenhout notifications@github.com wrote:

Hmm that’s strange. So no Config file is present @ $HOME/.rmapi?

Did you register your device first?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/subutux/rmapy/issues/12#issuecomment-770214593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFLFZPRSPM4JO74SHM35HLS4QEIDANCNFSM4WX2ORGA .

subutux commented 3 years ago

Hi,

I've just tested this, starting from scratch, with no $HOME/.rmapi file present.

In [5]: from rmapy.api import Client

In [6]: rmapy = Client()

In [7]: rmapy.is_auth()
Out[7]: False

In [8]: rmapy.register_device("akrxbsyw")
Out[8]: True

In [9]: rmapy.is_auth()
Out[9]: False

In [10]: rmapy.renew_token()
Out[10]: True

In [11]: rmapy.is_auth()
Out[11]: True

and my $HOME/.rmapi now contains both the devicetoken and usertoken. is your $HOME/.rmapi writable?

Could you try to remove your $HOME/.rmapi file and register again?

micheledicosmo commented 3 years ago

Still no luck by deleting the file and redoing: same behaviour. Are both token set by rmapy as part of the same operation?

subutux commented 3 years ago

Which version are you using?

subutux commented 3 years ago

I'm closing this issue because I cannot reproduce it.