-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Middleware stack mangled by 1.4.0 #3048
Comments
For me, this cause CSRF exception for existing user. |
Updating from 1.3.0 to 1.4.0 broke my test suite too |
For me, this commit override my session store from :mongoid_store to :cookie_store. |
The commit causing this problem seems very little thought through. Forcefully (as opposed to "optional") overriding global rails application settings in a gem is a very bad practice in my view. I can't believe it is your policy to only allow projects using session cookie store to use your excellent gem? Best regards, |
It's possible the author expected that the middleware change would only apply to requests that are handled by the rails_admin engine, and did not realise that middleware changes necessarily apply to all requests coming through Rack. I think all the middleware insertion should be configurable, because other than Rack::Pjax, all those added by rails_admin are already present in a standard rails app and are therefore being duplicated, as can clearly be seen in the output of rails middleware. This overriding of cookie configuration is only the most egregious example. Perhaps the middleware insertion belongs in the application's generated |
@inopinatus Agreed, but moving initializer to generator may break once fixed problem #2919 again for existing app without changing configuration manually. |
Hey all, just chiming in to say that we also noticed this causing issues in production when we realized that the amount of data in redis was dropping as we started to hit the TTL for those sessions. Worth mentioning that we do something slightly non standard in our routes file: |
Sorry for the issue, I've just pushed a fix for this. Please try with the latest master and give me feedback.
If this is okay for everyone, I'll push another gem release. |
Hi @mshibuya Seems to work nicely 👍 |
Hi @mshibuya Looks good here as well. Thanks for the fix! |
Updating to 1.4.0 broke my application due to this commit which installed middleware a standard Rails application already has, including cookie middleware which it then forcefully configures.
As a result, Rails now returns two session cookies in the HTTP response headers, and any cookie configuration you had previously gets thrown away.
In my case, this caused every app user to be logged out.
The text was updated successfully, but these errors were encountered: