feat: initialize PocketBase client with global auto-cancellation disabled and custom session expiry handling
All checks were successful
On Push to Main / test (push) Successful in 30s
On Push to Main / publish (push) Successful in 57s
On Push to Main / deploy-dev (push) Successful in 1m33s

This commit is contained in:
RaymondVerhoef
2026-05-17 15:27:34 +02:00
parent e2de7f0729
commit b28956bbe7

View File

@@ -5,6 +5,9 @@ const pbUrl = import.meta.env.VITE_PB_URL ||
export const pb = new PocketBase(pbUrl);
// Globally disable auto cancellation to prevent React StrictMode from aborting requests
pb.autoCancellation(false);
// Detect auth portal session expiry: the portal returns HTML instead of JSON.
// This prevents cryptic "Unexpected token '<'" errors when the session expires.
pb.afterSend = function (response, data) {