Starlette v0.26.0 support and authorize_redirect fix - #533
Conversation
…ns a URL instance and not a string
|
How about just |
|
@lepture That is indeed true, but my thinking was that just casting to a string by default could introduce sutble gotchas if Starlette's More than happy to be told I'm being overly cautious here; it wouldn't be the first time. |
|
@lepture Thanks! 😄 |
Starlette
0.26.0changed the return value ofurl_for()fromstrtoURL; see Kludex/starlette#1385 for context.Passing a
redirect_uritoauthorize_redirectcauses aTypeError: cannot convert 'URL' object to bytesexception to be raised if the URL has been generated viaurl_for(). This fix detects an instance ofURLand casts it to a string, thus allowing authentication to proceed and generally making people happy.What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)