Skip to content

Conversation

@D34DPlayer
Copy link
Contributor

#22 fixes the token refreshing not working at all, but it still uses the stored username and password to work. This PR stores the refreshToken on the first login and uses it on the api/auth/token route to login without credentials.

Also, refreshToken expires 7 days after being issued, and gets refreshed with the actual token, so there's no way it'll expire in between refreshes.

Besides that I also added a token_login method to reuse an user provided token/refreshToken. I'm creating an app that performs actions on TB as the app user and this would allow me to only use their tokens instead of storing their credentials.

- Rename `self.token_info.refreshToken` to `exp`
- Stop storing the username/password
- Store the `refreshToken` from the login request
@imbeacon imbeacon merged commit d105c10 into thingsboard:master Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants