Default user login token

Albert van Eck2 years ago

Dear all,

I have added a read-only (Values set to true: readonly, device readonly, no email change) user to show certain device(s) publically to anyone hitting a specific URL. The URL redirects to my Traccar instance and adds a token to the link and this initially works well. The problem seems that somehow the token is destroyed or changed over time (after two or three days). It might be due to someone using the redirected URL, clicking on log out or something like that.

Is it possible to have a token persistent or make an API call to set a specific token for a user? I don't see such an attribute in the API documentation under the user object modification. I also don't see that the token is captured in the database, so I can't "override/set" it by those means.

Any advice would be greatly appreciated.

Anton Tananaev2 years ago

Tokens have expiration. By default it's 7 days, but you can set your own time. You can use the API for that. Check the web app code on master for an example.