truman
(truman)
Octobre 24, 2025, 7:59
1
version : v3.5.1
mon site web : https://www.example.com/forum
la connexion locale (page d’accueil) redirigera vers https://www.example.com
La connexion depuis une page non-accueil ne présente pas ce problème.
journal
Traitement par StaticController#enter en tant que HTML Paramètres : {"username"=>"****", "password"=>"[FILTERED]", "redirect"=>"https://www.example.com/forum/login"} Redirigé vers https://www.example.com/
1 « J'aime »
pmusaraj
(Penar Musaraj)
Octobre 24, 2025, 1:44
2
Merci pour le rapport, nous allons nous y pencher bientôt.
2 « J'aime »
J’ai le même problème. Version : 3.6.0.beta3
1 « J'aime »
Nous rencontrons le même problème après l’installation de 2025.12.0-latest.
@here désolé pour cela, je pense avoir réussi à reproduire et à corriger le problème
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 « J'aime »
zogstrip
A fermé ce sujet ()
Décembre 12, 2025, 7:00
8
Ce sujet a été automatiquement fermé après 16 heures. Les nouvelles réponses ne sont plus autorisées.