Commit b220420
authored
fix: reset Cloudflare Turnstile token on signup errors (#24927)
* fix: cloudflare turnstile token reset
* fix: silently reset turnstile on invalid token error
* refactor: remove unused forwardRef logic from Turnstile component
- Remove forwardRef, useImperativeHandle, and useRef imports
- Remove unused TurnstileInstance type export
- Simplify to a plain function component
- The ref-based reset was replaced by key-based remount in signup-view
* refactor: remove redundant cfToken validation check
The submit button is already disabled when cfToken is missing,
making this defensive check unreachable during normal form flow.
* revert prettier formatiing
* chore: revert yarn.lock changes
* refactor(auth): use shared constant for cloudflare token error message
Replace hardcoded "Invalid cloudflare token" string with an exported
constant to prevent silent breakage if the error message changes.1 parent 7d5e9a4 commit b220420
File tree
2 files changed
+20
-7
lines changed- apps/web/modules
- packages/lib/server
2 files changed
+20
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| 195 | + | |
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| |||
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
210 | | - | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
309 | 317 | | |
310 | 318 | | |
311 | 319 | | |
| |||
512 | 520 | | |
513 | 521 | | |
514 | 522 | | |
| 523 | + | |
515 | 524 | | |
516 | 525 | | |
517 | 526 | | |
518 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
519 | 534 | | |
520 | 535 | | |
521 | 536 | | |
| |||
558 | 573 | | |
559 | 574 | | |
560 | 575 | | |
561 | | - | |
562 | 576 | | |
563 | 577 | | |
564 | 578 | | |
| |||
588 | 602 | | |
589 | 603 | | |
590 | 604 | | |
591 | | - | |
592 | | - | |
593 | | - | |
| 605 | + | |
594 | 606 | | |
595 | 607 | | |
596 | 608 | | |
| |||
640 | 652 | | |
641 | 653 | | |
642 | 654 | | |
643 | | - | |
644 | 655 | | |
645 | 656 | | |
646 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
0 commit comments