Closed blag closed 7 months ago
This whole set of parameters for display only is due for a rework anyway. This is a great new feature, implementation wise I'd see a single parameter (or maybe something decoupled from the auth class entirely, need to think about it a bit)
Failed conditions
27.7% Duplication on New Code (required ≤ 3%)
Thanks for the work on this. As said, I think I will rework it a bit before pushing it as part of a new release.
Sounds good, I appreciate you picking it up and running with it. And thank you for authoring this project to begin with. httpx
and this project have greatly simplified what I'm doing!
Feel free to ping me for any reviews or whatever regarding this feature. I'm already using my fork in a dev environment, so I can easily try out whatever you cook up and offer feedback/user testing.
Thanks for the proposal @blag , this new feature will be part of next release and you can already test it in the develop branch (check the README / CHANGELOG files on develop for more details on the changes related to this)
tl;dr: The templates are now provided via httpx_auth.OAuth2.display
.success_html
/ failure_html
. The defaults also changed to be more modern, you can check them out :)
Release 0.21.0 is now available on pypi
Looks great, thank you for being so responsive!
Instead of hard-coding the HTML templates for the authorization code flow, expose them as options to
OAuth2AuthorizationCode
and all subclasses.This allows users of this library to ensure that the templates match their site branding.
The new parameters are optional and default to values that are the exact same HTML as before.
I don't fully document what the default templates are, since I'm not really sure where the best place to do so would be.
Also added tests to ensure they work properly.