onedrive-api
onedrive-api copied to clipboard
Add serialization support for TokenResponse struct
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.
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.