Users should be asked to log back in if they have expired/invalid tokens.
Current Behavior
Currently, if a user performs an operation that results in a call to the API, and the API responds with a 400 due to an invalid auth token, the user is not notified of why the operation failed, but only the fact of it. Instead, they should be prompted to log back into the app in order to obtain a valid auth token.
Possible Solution
Create a redux action that when invoked, logs the user out of the app, and displays a modal requesting that they log back in. Parse all responses from API requests that can fail due to invalid tokens, and dispatch that action when they fail because of an invalid token.
Expected Behavior
Users should be asked to log back in if they have expired/invalid tokens.
Current Behavior
Currently, if a user performs an operation that results in a call to the API, and the API responds with a
400
due to an invalid auth token, the user is not notified of why the operation failed, but only the fact of it. Instead, they should be prompted to log back into the app in order to obtain a valid auth token.Possible Solution
Create a redux action that when invoked, logs the user out of the app, and displays a modal requesting that they log back in. Parse all responses from API requests that can fail due to invalid tokens, and dispatch that action when they fail because of an invalid token.