Fix: Ensure autogenerate_code_verifier defaults to True in from_client_config
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:
- [x] Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
Fixes #354 🦕
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:
if self.code_verifier is None and self.autogenerate_code_verifier:
My thoughts are:
- We want to use PKCE as much as possible.
- This keeps the logic near where the variables are used, so other refactors don't accidentally revert this behavior and new constructors don't have to repeat this check.
@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!