Closed dkniffin closed 7 years ago
@dkniffin Probably going to have to fix that same test you did on stilio_fe
Well, I did fix it here. Not sure why this is erroring...
Give Greg a chance to review this as well since he expressed interest in doing so in Slack. But I definitely give it a :shipit:. Good stuff man. Just get that test passing.
👍
Why?
On backend non-401 errors (eg 422), users were being logged out.
What changed?
Added a missing
else
case for theinvalidateHeaders
interceptor. Basically, what was happening is when a 422 occurred, that function would get called (instead ofsaveTokenInfo
). Since it wasn't a 401, it wouldn't log us out yet, but it also wouldn't save the response tokens. So on the next request, we'd send an old token, and the BE would 401, and we'd be kicked out.