Users are experiencing 403 errors when trying to sign in to their Discourse forums, particularly after updating to version 1.7.0 or later. The issue is linked to CSRF token verification failures, with logs showing Can't verify CSRF token authenticity. The root cause is identified as missing HTTPS forwarding headers in the proxy configuration, especially when using HTTPS. Maakuth resolved the issue by adding RequestHeader set X-Forwarded-Proto "https" to their Apache setup. Frey provided steps to disable force_https via the Rails console if the setting is misconfigured. cloudunicorn confirmed the problem persists in a Digital Ocean setup, suggesting the issue may be related to the use of Cloudflare and the need to configure proxy headers properly. codinghorror reiterated that the problem typically stems from improper proxy configuration, especially when the site uses HTTPS.
I am seeing this as well. In the logs, I’m seeing:
Started GET "/session/csrf?_=1485544587272" for <ip> at 2017-01-27 19:16:45 +0000
Processing by SessionController#csrf as */*
Parameters: {"_"=>"1485544587272"}
Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.0ms)
Started POST "/session" for <ip> at 2017-01-27 19:16:46 +0000
Processing by SessionController#create as */*
Parameters: {"login"=>"username", "password"=>"[FILTERED]"}
Can't verify CSRF token authenticity
Rendered text template (0.0ms)
Filter chain halted as :verify_authenticity_token rendered or redirected
It has been like this for a few days, I think since updating to 1.7.0. I’ve installed the 1.7.1 fix but it didn’t help. Trying now with the 1.7.2, but by the looks of the diff, this issue isn’t fixed there.
My users just started seeing “403 Unknown Error” when trying to log in. I followed these instructions - but I’m now getting an error in the admin settings: " * Your website is using SSL. But [force_https](https://movermaker.com/admin/site_settings/category/all_results?filter=force_https) is not yet enabled in your site settings."
I am using the Digital Ocean app setup with nothing custom, and ‘v2.0.0.beta2 +170’. Is this because I’m using a beta version?
Not fun, this is still happening to users - getting “Unknown Error” when trying to log in, and 403 Forbidden error when trying to reset password. I’m now on current Discourse.