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

store creds correctly when authorized_user_filename is passed to gspread.auth.oauth() #884

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

sarisia
Copy link
Contributor

@sarisia sarisia commented Jun 1, 2021

Summary

#847 allows users to use custom path for authorized user credentials.

With current implementation, when I call gspread.auth.oauth() with custom path,
oauth() reads credentials from the given path correctly, but if credentials file is missing,
it authorizes user and store the credentials to the default path (~/.config/gspread/credentials.json),
not the custom path!

According to the docs, this behavior is incorrect:
https://github.com/burnash/gspread/blob/master/docs/oauth2.rst

If you want to store the credentials file somewhere else, specify the path to authorized_user.json

This PR fixes store_credentials() in gspread.auth.oauth() to store creds correctly when authorized_user_filename is passed to gspread.auth.oauth().

fix store_credentials to store creds correctly when authorized_user_filename is passed.
@sarisia sarisia changed the title fix store_credentials store creds correctly when authorized_user_filename is passed to gspread.auth.oauth() Jun 1, 2021
Copy link
Collaborator

@lavigne958 lavigne958 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test ✔️

@lavigne958 lavigne958 merged commit 38dd67b into burnash:master Jun 2, 2021
@lavigne958
Copy link
Collaborator

Thank you @sarisia for this contribution 🙂

@lavigne958 lavigne958 added this to the 3.8.0 milestone Jul 8, 2021
@lavigne958 lavigne958 modified the milestones: 3.8.0, 4.0.0 Aug 1, 2021
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