Repository navigation
Commit d108cc1
authored
fix: strip the development forum's accounts and sessions from the Flarum seed (#9127)
### What changes were proposed in this PR?
`bin/forum/flarum.sql` was dumped from a development forum and still
held its member accounts, login sessions, visit logs with IP addresses,
and an API key that the dashboard's forum sign-up sent.
- `flarum.sql`: the three seeded accounts get placeholder emails
(`@example.com`) and no password, so their posts stay but nobody can
sign in as them. The sessions, the API key and the visit log are
dropped, and the posts' IP addresses are cleared.
- Sign-up without the key: the seed already allows open sign-up
(`allow_sign_up = 1`), so the key only let `FlarumService.register` skip
Flarum's CSRF check. The new `bin/extend.php` exempts the sign-up route
instead (by default Flarum exempts only login), and both install scripts
copy it into the forum.
### Any related issues, documentation, discussions?
Closes #9126. Independent of #9005, which is under discussion in #9006.
### How was this PR tested?
- `flarum.service.spec.ts` now checks that sign-up sends no
`Authorization` header. It passes, and fails against the old service.
- On Flarum 1.8.5 (the seed's version) with the cleaned seed: the seed
imports, sign-up then login works with `extend.php`, sign-up is rejected
by the CSRF check without it, and the seeded accounts cannot sign in.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-5-5)1 parent 98c6337 commit d108cc1
7 files changed
Lines changed: 37 additions & 15 deletions
File tree
- bin
- forum
- frontend/src/app/dashboard/service/user/flarum
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
41 | 38 | | |
42 | | - | |
43 | | - | |
| 39 | + | |
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
| |||
0 commit comments