From 4c0270a142995aaf72fd1f13c1ac7f50f3d67fc9 Mon Sep 17 00:00:00 2001 From: Tobias Arends Date: Mon, 2 Dec 2024 15:32:41 +0100 Subject: [PATCH] fix(payload): remove duplicate afterRead collection hook call on loginOperation --- packages/payload/src/auth/operations/login.ts | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/payload/src/auth/operations/login.ts b/packages/payload/src/auth/operations/login.ts index bbc2c28a9f3..97d2ae986b4 100644 --- a/packages/payload/src/auth/operations/login.ts +++ b/packages/payload/src/auth/operations/login.ts @@ -292,22 +292,6 @@ export const loginOperation = async ( })) || 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 } & Result = { exp, token,