-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fix: Ensure autogenerate_code_verifier defaults to True in from_client_config #356
base: main
Are you sure you want to change the base?
Conversation
google_auth_oauthlib/flow.py
Outdated
@@ -161,6 +161,8 @@ def from_client_config(cls, client_config, scopes, **kwargs): | |||
# these args cannot be passed to requests_oauthlib.OAuth2Session | |||
code_verifier = kwargs.pop("code_verifier", None) | |||
autogenerate_code_verifier = kwargs.pop("autogenerate_code_verifier", None) |
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.
autogenerate_code_verifier = kwargs.pop("autogenerate_code_verifier", None) | |
autogenerate_code_verifier = kwargs.pop("autogenerate_code_verifier", True) |
google_auth_oauthlib/flow.py
Outdated
if not code_verifier and autogenerate_code_verifier is None: | ||
autogenerate_code_verifier = True |
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.
I think let's revert this, and instead add a guard in the autogenerate logic.
Not sure I am doing something wrong here, but I cannot leave a comment on this line. Maybe because your PR does not touch it? Instead, I think we should change line 242 to:
My thoughts are:
@Perun108 what are your thoughts? |
@clundin25 Thank you so much for the suggestions. They make total sense. I updated my PR accordingly, please review. Thanks! |
Thank you @Perun108 for your contribution! This looks great! Would you mind fixing the unit tests? |
@clundin25 Thank you, I'm so happy you found my little contribution valuable. Sure, I will try to fix the unit tests, but it will probably take me some time to figure out how the tests are set up and how the objects are mocked. |
@clundin25 Could you please take a look at my updated PR? I fixed failing tests. Thanks! |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #354 🦕