Skip to content

Commit 439dd04

Browse files
authored
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.
1 parent a3457af commit 439dd04

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/payload/src/auth/operations/forgotPassword.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export const forgotPasswordOperation = async <TSlug extends CollectionSlug>(
132132
// as doing so could lead to the exposure of registered emails.
133133
// Therefore, we prefer to fail silently.
134134
if (!user) {
135+
await commitTransaction(args.req)
135136
return null
136137
}
137138

0 commit comments

Comments
 (0)