zetkin / organize.zetk.in

Organizer front-end of the Zetkin system for organizing activism
21 stars 14 forks source link

Organize submits expired access token #1277

Open niklasva82 opened 3 years ago

niklasva82 commented 3 years ago

To reproduce:

  1. Use a short expiration for access tokens
  2. Go to organize.dev.zetkin.org/people/list
  3. Wait for the access token to expire
  4. Click any of the people in the list

Expected: Sucessfully make XMLHttpRequest to fetch the person and its related fields and tags. Actual: 401 {"error":"invalid_token","error_description":"Invalid token: access token has expired"}

Refreshing works as expected.

richardolsson commented 3 years ago

I'm surprised that this isn't handled by the loginRedirect middleware in Redux, which should force a browser refresh when this happens. For anyone working on this issue, that's a good place to start.

https://github.com/zetkin/zetkin-common/blob/b1fd25ca1029b1fcea78aa89e5e69d3f97d417ca/redux/middleware/loginRedirect.js#L23-L31