maryvilledev / codesplainUI

Web app for breaking down and annotating Python 3 source code.
https://www.codesplain.io
GNU General Public License v3.0
2 stars 2 forks source link

Logout users with expired tokens #465

Closed Hopding closed 7 years ago

Hopding commented 7 years ago

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.