自动重定向不应引入任何安全漏洞。如果您发现任何可利用的漏洞,请通过我们的漏洞披露计划告知我们:discourse/docs/SECURITY.md at main · discourse/discourse · GitHub
我认为在有更多用户请求此更改之前,我们不想在设置中增加更多干扰项。
您可以通过插件覆盖此方法来实现,只需修补该方法即可:
因此,我认为您应该将函数简化为:
def redirect_to_login
dont_cache_page
cookies[:destination_url] = destination_url
redirect_to path("/login")
end