You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to implement auto-refreshing of a token but in order to get the new token I need to be able to read the server response in the custom auth_flow method.
It seems like a trivial change to get the client to read() or aread() the response before sending it back (like it does with the request), and things actually seem to work fine, but some tests break which I don't understand so wanted to check that I'm not doing completely the wrong thing here.
Activity
florimondmanca commentedon Feb 3, 2020
Hi!
I assume you’d like to access the response body because the server returns an auth token as a JSON payload, eg
{"token": "123abc"}, right?Being able to access the request body is documented at the end of Customizing Authentication, but we don’t have such a flag for responses yet.
Sounds like a sensible symmetric addition to me, though! Want to throw a PR together to see what it would look like? :)
lovelydinosaur commentedon Feb 3, 2020
Indeed, adding a
requires_response_bodyattribute would make sense.georgek commentedon Feb 3, 2020
OK, great! I'll have a go at it today.