Hooks

sanctum:logout

Subscribe to logout hook to inject custom event handling

Usage

Subscribe to the sanctum:logout hook which triggers once the user is logged out and the identity reset is done.

app/plugins/sanctum-listener.ts
export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.hook('sanctum:logout', () => {
    console.log('Sanctum logout hook triggered')
  })
})

Here is what the hook looks like

interface RuntimeNuxtHooks {
 /**
  * Triggers when user successfully logs out.
  */
 'sanctum:logout': () => HookResult
}