-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added support for private profiles #49
Added support for private profiles #49
Conversation
d726240
to
66a1de5
Compare
For the record: I force-pushed because the previous commits didn't have semantic commit messages. |
Thanks for the PR and sorry for the late review, merging in! |
OAuthAccessToken = | ||
OAuthRefreshToken = | ||
OAuthRefreshTokenExpiresAt = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these three values are fetched by the application and not set by the user, this should not live in the credentials.ini
(user configuration) file but in a separate "cache" file. This would make a consistent config file across multiple machines (useful for dotfiles).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #46 (comment)
π Description
Implements #35 by optionally using OAuth.
β Checks
cargo fmt
.)βΉ Additional Information
This PR adds the following entries to
credentials.ini
:If the user wants to enable OAuth, it is expected that they set
enabledOAuth = true
andtraktClientSecret = <trakt client secret>
, otherwise they can be left as is. The three other fields are set programmatically.Application flow for using OAuth for the first time:
I haven't found a nice way to write the generated tokens back tocredentials.ini
. The straightforward way to loading the whole config, changing the token entries and writing the whole config back tocredentials.ini
results in "ugly" formatting. Maybe writing them to the file "manually" would be better (but somewhat annoying to implement)?The order of the entries in
credentials.ini
is now kept the same when writing the OAuth tokens back to the file (4336736). The only thing left regarding "ugly" formatting is that the spaces around the equal signs are removed when writing the values back to the file, but I haven't found a fix for that.