1c2de6ca79
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>
9 lines
246 B
JavaScript
9 lines
246 B
JavaScript
import { Controller } from "@hotwired/stimulus"
|
|
|
|
export default class extends Controller {
|
|
async clearCache() {
|
|
const registration = await navigator.serviceWorker?.ready
|
|
registration?.active?.postMessage({ action: "clearCache" })
|
|
}
|
|
}
|