Clear offline cache on sign-in as well as sign-out

Rename logout controller to clear-offline-cache and attach it to the
magic link verification form so the service worker cache is cleared
when a different user signs in.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Rosa Gutierrez
2026-02-20 11:31:36 +01:00
parent 089fcf94f8
commit 1c2de6ca79
4 changed files with 3 additions and 3 deletions
@@ -0,0 +1,8 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
async clearCache() {
const registration = await navigator.serviceWorker?.ready
registration?.active?.postMessage({ action: "clearCache" })
}
}