Fix `InsecureTransportError` raising by azmeuk · Pull Request #810 · authlib/authlib

@azmeuk

There was an issue with InsecureTransportError being raised while the
request has not fully been initialized by Django/Flask. Then the
authorization server would try to catch the exception and enrich with
request.payload.state, that don't exist because the request is not
initialized.

The fix is to avoid enriching the 'state' parameter for exceptions
raised during the request initialization, that for the moment can only
be InsecureTransportError.

@azmeuk azmeuk deleted the 795-django-request-payload branch

August 27, 2025 20:46