Redirect all controllers to login if required

We want to skip the filter for sessions controller so that we can login
and we want to skip the filter for static pages because those should be
visible to visitors.
This commit is contained in:
Chris Hunt
2013-06-04 16:10:10 -07:00
parent 85ceb5efa7
commit 92a4828f72
4 changed files with 26 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@ class SessionController < ApplicationController
# page is going to be empty, this means that server will see an invalid CSRF and blow the session
# once that happens you can't log in with social
skip_before_filter :verify_authenticity_token, only: [:create]
skip_before_filter :redirect_to_login_if_required
def create
requires_parameter(:login, :password)