Skip to content

Commit

Permalink
fix(payload): remove duplicate afterRead collection hook call on logi…
Browse files Browse the repository at this point in the history
…nOperation
  • Loading branch information
1b0t committed Dec 2, 2024
1 parent 71ba4a8 commit 4c0270a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions packages/payload/src/auth/operations/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,22 +292,6 @@ export const loginOperation = async <TSlug extends CollectionSlug>(
})) || user
}, Promise.resolve())

// /////////////////////////////////////
// afterRead - Collection
// /////////////////////////////////////

await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {
await priorHook

user =
(await hook({
collection: args.collection?.config,
context: req.context,
doc: user,
req,
})) || user
}, Promise.resolve())

let result: { user: DataFromCollectionSlug<TSlug> } & Result = {
exp,
token,
Expand Down

0 comments on commit 4c0270a

Please sign in to comment.