Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an axios global handler and handle 401 errors within browser buttons #966

Closed

Conversation

antonioribeiro
Copy link
Member

@antonioribeiro antonioribeiro commented Jun 8, 2021

This PR injects a global error handler on Axios in order to catch 401 errors happening on places not handled today, like browser buttons. When forcing a session to expire manually, these are the outcomes

Clicking a browser button:

Screenshot 2021-06-08 at 01 55 58

When trying to save the form I initially got this one, because the error was 419 (CSRF token mismatch) and not 401.

Screenshot 2021-06-08 at 02 10 40

So now handling also 419, we get this when trying to save

Screenshot 2021-06-08 at 02 06 10

Closes #964.

@antonioribeiro antonioribeiro changed the title Feature/axios global handler Add an axios global handler and handle 401 errors within browser buttons Jun 8, 2021
ifox added a commit that referenced this pull request Jul 21, 2021
Compile assets

Also handle 419 errors

Compile assets

Merges #966
@ifox ifox force-pushed the feature/axios-global-handler branch from 15691e1 to 13c4582 Compare July 21, 2021 00:33
@ifox ifox closed this in c626a14 Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force user logout on frontend when session expires
2 participants