Stop service worker interfering with Identity UI (#19400)

This commit is contained in:
Steve Sanderson 2020-02-28 06:42:44 +00:00 committed by GitHub
parent 252576df5a
commit 0216ca2086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -43,7 +43,13 @@ async function onFetch(event) {
if (event.request.method === 'GET') {
// For all navigation requests, try to serve index.html from cache
// If you need some URLs to be server-rendered, edit the following check to exclude those URLs
//#if(IndividualLocalAuth && Hosted)
const shouldServeIndexHtml = event.request.mode === 'navigate'
&& !event.request.url.includes('/connect/')
&& !event.request.url.includes('/Identity/');
//#else
const shouldServeIndexHtml = event.request.mode === 'navigate';
//#endif
const request = shouldServeIndexHtml ? 'index.html' : event.request;
const cache = await caches.open(cacheName);