Cannot access Gramps Web once Cloudflare Access session expires

So I have my Gramps Web sitting behind Cloudlfare Access.
It works fine until I come back a day later (or how long it takes for the Access session to expire) and I get a blank page with nothing in it.

I assume there is something wrong with the service worker because if I unregister it and reload the page, it will corectly redirect to the Access login page.

Console Logs

Access to manifest at 'https://mywebsite.cloudflareaccess.com/cdn-cgi/access/login/mywebsite.com?kid=...&meta=...&redirect_url=%2Fmanifest.json' (redirected from 'https://mywebsite.com/manifest.json') from origin 'https://mywebsite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://mywebsite.cloudflareaccess.com/cdn-cgi/access/login/mywebsite.com?kid=...&meta=...&redirect_url=%2Fmanifest.json net::ERR_FAILED 200 (OK)

Access to script at 'https://mywebsite.cloudflareaccess.com/cdn-cgi/access/login/mywebsite.com?kid=...&meta=...&redirect_url=%2FBbYCh_AI.js' (redirected from 'https://mywebsite.com/BbYCh_AI.js') from origin 'https://mywebsite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://mywebsite.cloudflareaccess.com/cdn-cgi/access/login/mywebsite.com?kid=...&meta=...&redirect_url=%2FBbYCh_AI.js net::ERR_FAILED 200 (OK)

ServiceWorker registered.

Access to manifest at 'https://mywebsite.cloudflareaccess.com/cdn-cgi/access/login/mywebsite.com?kid=...&meta=...&redirect_url=%2Fmanifest.json' (redirected from 'https://mywebsite.com/manifest.json') from origin 'https://mywebsite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

GET https://mywebsite.cloudflareaccess.com/cdn-cgi/access/login/mywebsite.com?kid=...&meta=...&redirect_url=%2Fmanifest.json net::ERR_FAILED 200 (OK)

System Information

Gramps 6.0.8
Gramps Web API 3.12.0
Gramps Web Frontend 26.4.2
Gramps QL 0.4.0
Sifts 1.3.1
locale: en
multi-tree: false
task queue: true
OCR: true
chat: false

Good to know, thanks.

As I’m anyway about to release a new version, I made this change, that might fix it. Please report after the next upgrade.

Tried the new version but the issue still exists, although changed a litle bit.

When I manualy revoked the Access credentials and reloaded the Gramps website I got a Gramps Web “No connection” with a RELOAD button.
Pressing it (or pressing Ctrl+R) reloads with a progress bar but still shows the same thing.
There is also a notification “Error: Network error”.

Interestingly if I open Dev Tools and reload it will go back to the original issue with a white background and the same console log errors.

System Information

Gramps 6.0.8
Gramps Web API 3.12.1
Gramps Web Frontend 26.4.3
Gramps QL 0.4.0
Sifts 1.3.1
locale: en
multi-tree: false
task queue: true
OCR: true
chat: false