truman
(truman)
24. Oktober 2025 um 07:59
1
Version: v3.5.1
Meine Website: https://www.example.com/forum
Lokaler Login (Homepage) leitet zu https://www.example.com weiter.
Die Anmeldung von einer Nicht-Homepage aus hat dieses Problem nicht.
Protokoll
Processing by StaticController#enter as HTML Parameters: {"username"=>"****", "password"=>"[FILTERED]", "redirect"=>"https://www.example.com/forum/login"} Redirected to https://www.example.com/
1 „Gefällt mir“
pmusaraj
(Penar Musaraj)
24. Oktober 2025 um 13:44
2
Danke für den Bericht, wir werden uns bald darum kümmern.
2 „Gefällt mir“
Ich habe das gleiche Problem. Version: 3.6.0.beta3
1 „Gefällt mir“
Magnetidog
(Magnetidog)
10. Dezember 2025 um 19:24
6
Wir erleben dasselbe Problem nach der Installation von 2025.12.0-latest.
@here Entschuldigung dafür, ich glaube, ich konnte das Problem reproduzieren und beheben
main ← login-redirect-and-subfolder-equals-boom
opened 10:46PM - 10 Dec 25 UTC
When Discourse is served from a subfolder (e.g., /forum), logging in from the lo… gin page itself would incorrectly redirect users to the root domain (/) instead of the subfolder root (/forum/).
The issue had two causes:
1. The login path check in `extract_redirect_param` used the Rails `login_path` helper which returns "/login" without the subfolder prefix. When the browser sent the full path "/forum/login", the check `starts_with?("/login")` failed to match, treating it as a valid redirect target instead of rejecting it.
2. The `enter` method didn't apply the subfolder prefix when falling back to the root path "/".
Fixed by:
- Building the full login path with `Discourse.base_path` for accurate matching in subfolder setups
- Wrapping the fallback "/" with `path()` in `enter` to respect the subfolder configuration
- Extracting redirect validation into `valid_redirect_uri?` for clarity
Ref - meta/t/386619
3 „Gefällt mir“
zogstrip
Geschlossen,
12. Dezember 2025 um 07:00
8
Dieses Thema wurde nach 16 Stunden automatisch geschlossen. Neue Antworten sind nicht mehr erlaubt.