I can not get current_user
method in controllers inherited from WebsocketRails :: BaseController (in production environment). There is no error in the log, the controller simply stops execution. I am logging current_user and in the development environment I see the value, and in the production environment the variable is empty. What is the significant difference between running rails s -e development
and rails s -e production
?
I even tried to copy configs from deva to production (config / environments / production.rb). But still.
I use the following gems for Ruby 2.2.0 and rails 4.2.0 rails:
websocket-rails (0.7.0) faye-websocket (0.9.2) websocket-driver (>= 0.5.1) devise (3.4.1)
Respectively, Thin server, for web-ketoa, I launch rake websocket_rails websocket_rails:start_server
on port 3001 and connect to it correctly.
If you do not access current_user
, but simply pull out any user from the database, the method works without problems, that is, the sockets are in order, the connection is there, the controller does not see the only Devise current_user, and this is only in the production environment.
After successful authorization in development in the log:
current_user:#<User:0x00000005bfe988>
In production in the log:
current_user:
Empty, although only Wednesday has changed.
PS everything is fine with the base, not websockets methods work correctly.