Hooks

sanctum:login

Subscribe to login hook to inject custom event handling

Usage

Subscribe to the sanctum:login hook which triggers once the user is logged in and the identity refresh request is completed.

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

Here is what the hook looks like

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