Fix expired session login redirect. #170
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we switched to session based authentication from token based, we
introduced an undesired UX issue when a session expires. In summary,
when a session expires, the desired functionality is that the user will
be presented with a message indicating the expiration and prompted to
login in again.
While the first of these was occuring in the form of a formatted HTTP
error output the latter was not. Also, the form of the error was less
than desirable too.
Therefore, what we've done here is updated the error handling around
session expiration/unauthorized errors to prompt the user to login
again. Also, we've taken the opporunity to clean up the error output of
other API errors as well such that it's presents the error. Use of
HTTP_DEBUG
is still supported if the full HTTP error details isnecessary for debugging purposes.