ruby on rails - Forcing ssl on devise controller redirects to GET instead of DELETE on sign_out -
i've placed config.to_prepare { devise::sessionscontroller.force_ssl }
in production.rb
in order require logging in/out via https.
unfortunately, force_ssl
seems forget original request method. logs:
started delete "/users/sign_out" (...) processing users::sessionscontroller#destroy html parameters: {"authenticity_token"=>"foo"} user load (0.8ms) select "users".* "users" "users"."id" = id order "users"."id" asc limit 1 redirected https://my.domain/users/sign_out filter chain halted #<proc:some-ruby-path/gems/actionpack-4.1.5/lib/action_controller/metal/force_ssl.rb:65> rendered or redirected completed 301 moved permanently in 6ms (activerecord: 0.8ms) started "/users/sign_out" (...) actioncontroller::routingerror (no route matches [get] "/users/sign_out")
any ideas how tackle this? seems common problem.
class applicationcontroller < actioncontroller::base private # overwriting sign_out redirect path method def after_sign_out_path_for(resource_or_scope) root_path end end
from devise docs signout, change root_path root_path :protocol => 'http://'. once signout, return page.
Comments
Post a Comment