Skip to content

Commit c5fe021

Browse files
authored
fix: duplicate afterRead collection hook call on loginOperation (#9664)
Hi there, i noticed that the `afterRead` hook is triggered twice on `loginOperation`. This just removes the duplicated code. -Tobi
1 parent edc04ae commit c5fe021

File tree

1 file changed

+0
-16
lines changed
  • packages/payload/src/auth/operations

1 file changed

+0
-16
lines changed

packages/payload/src/auth/operations/login.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -292,22 +292,6 @@ export const loginOperation = async <TSlug extends CollectionSlug>(
292292
})) || user
293293
}, Promise.resolve())
294294

295-
// /////////////////////////////////////
296-
// afterRead - Collection
297-
// /////////////////////////////////////
298-
299-
await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {
300-
await priorHook
301-
302-
user =
303-
(await hook({
304-
collection: args.collection?.config,
305-
context: req.context,
306-
doc: user,
307-
req,
308-
})) || user
309-
}, Promise.resolve())
310-
311295
let result: { user: DataFromCollectionSlug<TSlug> } & Result = {
312296
exp,
313297
token,

0 commit comments

Comments
 (0)