Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serialization support for TokenResponse struct #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlexanderProd
Copy link

It would be nice to have serialization support for the TokenResponse struct, to save it to a file for persistence between app restarts without having to manually log in again.

@oxalica
Copy link
Owner

oxalica commented May 27, 2024

It would be nice to have serialization support for the TokenResponse struct, to save it to a file for persistence between app restarts without having to manually log in again.

I'm not convinced by the reason. Serializing the whole TokenResponse, which is explicitly marked as #[non_exhaustive] and contains unrelated data like scope, does not really make sense. Also according to the OAuth design, token is expected to be short-lived (1hour expiration time by default). My suggestion is to store only refresh_token and keep the token only in memory.

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