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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user