Skip to content

Instantly share code, notes, and snippets.

View grinsteindavid's full-sized avatar
🏠
Working from home

David M grinsteindavid

🏠
Working from home
View GitHub Profile
@yajra
yajra / axios-401-response-interceptor.js
Last active September 20, 2023 06:24
Axios 401 response interceptor.
// 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,
@pierophp
pierophp / index.html
Last active December 30, 2021 10:59
Communication Between Tabs With Shared Worker
<html>
<body>
<a id="worker-message" href="javascript:void(0)">Send Message</a>
<script src="test.js"></script>
</body>
</html>