truman
(truman)
2025 年 10 月 24 日午前 7:59
1
バージョン: v3.5.1
私のウェブサイト: https://www.example.com/forum
ローカルログイン(ホームページ)は https://www.example.com にリダイレクトされます。
ホームページ以外からログインしても、この問題は発生しません。
ログ
Processing by StaticController#enter as HTML Parameters: {"username"=>"****", "password"=>"[FILTERED]", "redirect"=>"https://www.example.com/forum/login"} Redirected to https://www.example.com/
「いいね!」 1
pmusaraj
(Penar Musaraj)
2025 年 10 月 24 日午後 1:44
2
ご報告ありがとうございます。近日中に確認いたします。
「いいね!」 2
私も同じ問題が発生しています。バージョン:3.6.0.beta3
「いいね!」 1
2025.12.0-latest をインストールした後、同じ問題が発生しています。
@here すみません、問題を再現し修正できたと思います
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
zogstrip
クローズされました:
2025 年 12 月 12 日午前 7:00
8
このトピックは16時間後に自動的にクローズされました。新しい返信は許可されていません。