truman
(truman)
24.Октябрь.2025 07:59:33
1
Версия: v3.5.1
Мой сайт: https://www.example.com/forum
Локальный вход (на главной странице) перенаправляет на https://www.example.com
Вход с не главной страницы не имеет этой проблемы.
лог
Обработка запроса: StaticController#enter как HTML Параметры: {"username"=>"****", "password"=>"[FILTERED]", "redirect"=>"https://www.example.com/forum/login"} Перенаправление на https://www.example.com/
1 лайк
pmusaraj
(Penar Musaraj)
24.Октябрь.2025 13:44:31
2
Спасибо за отчет, мы скоро займемся этим.
2 лайка
У меня та же проблема. Версия: 3.6.0.beta3
1 лайк
Magnetidog
(Magnetidog)
10.Декабрь.2025 19:24:34
6
После установки версии 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 лайка
zogstrip
Закрыл(а) тему
12.Декабрь.2025 07:00:36
8
Эта тема была автоматически закрыта через 16 часов. Новые ответы больше не допускаются.