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:
@@ -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" })
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user