Skip to content

Commit

Permalink
feat!: call fetch hook if session is not empty instead of user defined
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Sep 25, 2024
1 parent 6ae7317 commit 07e09b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/server/api/session.get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import type { UserSessionRequired } from '#auth-utils'
export default eventHandler(async (event) => {
const session = await getUserSession(event)

if (session.user) {
// If session is not empty, call fetch hook
if (Object.keys(session).length > 0) {
await sessionHooks.callHookParallel('fetch', session as UserSessionRequired, event)
}

Expand Down

0 comments on commit 07e09b9

Please sign in to comment.