requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

Redo request after token is updated

Open ewtoombs opened this issue 2 years ago • 0 comments

https://github.com/requests/requests-oauthlib/blob/3a2a852e33c691c7e793300ce366a01b6e4b3848/requests_oauthlib/oauth2_session.py#L541

Seriously, why can't we just redo the request? That's what everybody's going to be doing anyway. Every project using this code is just going to write

result = None
while True:
    try:
        result = session.request(...)
    except TokenUpdated:
        pass

ewtoombs avatar Jan 19 '23 17:01 ewtoombs