ry fix pwa auth error locally

This commit is contained in:
Dobromir Popov
2024-04-13 12:40:20 +03:00
parent bcf843d515
commit 717cd8499d

View File

@ -2,6 +2,19 @@
console.log('Service Worker Loaded...')
self.addEventListener('fetch', (event) => {
try {
if (event.request.url.includes('/api/auth/callback/')) {
// Use network only strategy for auth routes, or bypass SW completely
event.respondWith(fetch(event.request));
return;
}
// other caching strategies...
} catch (error) {
console.error(error)
}
});
self.addEventListener('push', function (event) {
console.log('Push message', event)
if (!(self.Notification && self.Notification.permission === 'granted')) {