You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 25, 2021. It is now read-only.
rickygu edited this page Apr 4, 2012
·
7 revisions
The examples below only show how to make devise views into SSL. Since Rails uses a cookie for it's sessions, it is recommended that the entire website should use SSL for security reasons.
For Devise 1.0, one way to do sign_in over SSL is:
# in app/controllers/application_controller.rbclassApplicationController < ActionController::BaseincludeSslRequirement
...
end# in config/environment.rbconfig.to_preparedoSessionsController.ssl_required:new,:createRegistrationsController.ssl_required:new,:createend
If the code above just requires ssl on the first request in development, you may need to move the last line to a config.to_prepare block inside config/application.rb or config/environment.rb:
And make sure to enable SSL on the server (Nginx, Apache, etc.). If the servers are not configured properly, Rails will not recognize the request as SSL (even if it is), and cause an infinite redirect loop.