truman
(truman)
10월 24, 2025, 7:59오전
1
version: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개의 좋아요
저도 같은 문제가 있습니다. 버전: 3.6.0.beta3
1개의 좋아요
2025.12.0-latest 설치 후 동일한 문제가 발생하고 있습니다.
@here 죄송합니다. 문제를 재현하고 수정한 것 같습니다.
main ← login-redirect-and-subfolder-equals-boom
merged 09:42AM - 11 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개의 좋아요
이 주제는 16시간 후 자동으로 닫혔습니다. 더 이상 새 답변을 게시할 수 없습니다.