fix: commit transaction if a user isnt found in forgotPassword operation (#10055)

The forgotPassword operation exits silently if no user is found, but
because we don't throw an error the transaction never gets committed
leading to a timeout.
This commit is contained in:
Paul
2024-12-18 15:53:53 -06:00
committed by GitHub
parent a3457af36d
commit 439dd04ce9

View File

@@ -132,6 +132,7 @@ export const forgotPasswordOperation = async <TSlug extends CollectionSlug>(
// as doing so could lead to the exposure of registered emails.
// Therefore, we prefer to fail silently.
if (!user) {
await commitTransaction(args.req)
return null
}