Closed micheledicosmo closed 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)
Hmm that’s strange. So no Config file is present @ $HOME/.rmapi
?
Did you register your device first?
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 .
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?
Still no luck by deleting the file and redoing: same behaviour. Are both token set by rmapy
as part of the same operation?
devicetoken
is set by rmapy.api.Client.register_device()
,usertoken
by rmapy.api.Client.renew_token()
.Which version are you using?
I'm closing this issue because I cannot reproduce it.
The above code succeeds (API returns 200).
However, when I then do
rmapy.is_auth()
returnFalse
immediately after.