Commit fcd57ca
committed
Add missing next() call in Mongoose pre-save middleware hook (Issue #699)
Ensure proper middleware chain execution by calling next() in the pre-save hook. This prevents middleware chain interruption and ensures subsequent hooks are invoked correctly.
Changes:
- Added next parameter to pre-save hook
- Call next() when password modification check returns early
- Call next() at end of middleware to allow next hook execution
- Maintains compatibility with Mongoose middleware chain
Fixes #6991 parent 53f820b commit fcd57ca
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments