Skip to content

Instantly share code, notes, and snippets.

View NaturalDevCR's full-sized avatar
💭
I may be slow to respond.

Josue NaturalDevCR

💭
I may be slow to respond.
View GitHub Profile
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,