Open BananaAcid opened 1 year ago
Same session hooks can be used in the server (backend) and in the client (frontend), so you can use them in the front in a nuxt route middleware.
So:
export default defineNuxtRouteMiddleware(async () => {
const { session, refresh, update, reset } = await useSession()
})
Ask your question
Could you add an example on how to access the session using a nuxt3 route middleware with
defineNuxtRouteMiddleware()
to the readme?Additional information
referencing https://nuxt.com/docs/api/utils/define-nuxt-route-middleware#redirection