diff --git a/src/runtime/server/api/session.get.ts b/src/runtime/server/api/session.get.ts index f34f4d4..de94570 100644 --- a/src/runtime/server/api/session.get.ts +++ b/src/runtime/server/api/session.get.ts @@ -1,13 +1,12 @@ import { eventHandler } from 'h3' import { getUserSession, sessionHooks } from '../utils/session' -import type { UserSessionRequired } from '#auth-utils' export default eventHandler(async (event) => { const session = await getUserSession(event) // If session is not empty, call fetch hook if (Object.keys(session).length > 0) { - await sessionHooks.callHookParallel('fetch', session as UserSessionRequired, event) + await sessionHooks.callHookParallel('fetch', session, event) } const { secure, ...data } = session diff --git a/src/runtime/server/utils/session.ts b/src/runtime/server/utils/session.ts index d6940e4..c9f7384 100644 --- a/src/runtime/server/utils/session.ts +++ b/src/runtime/server/utils/session.ts @@ -11,7 +11,7 @@ export interface SessionHooks { * - Add extra properties to the session * - Throw an error if the session could not be verified (with a database for example) */ - fetch: (session: UserSessionRequired, event: H3Event) => void | Promise + fetch: (session: UserSession, event: H3Event) => void | Promise /** * Called before clearing the session */