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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user