title: Devise after_sign_in_path error: Filter chain halted as :require_no_authentication
body: <p>I'm following the Devise wiki to redirect the user to the current page after signing in (<a href="https://github.com/plataformatec/devise/wiki/How-To%3a-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update" rel="nofollow">https://github.com/plataformatec/devise/wiki/How-To:-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update</a>)</p>
  
  <p>However I'm getting the following error:</p>
  
  <pre><code>Started GET "/login" for 127.0.0.1 at 2014-05-12 18:52:52 -0300
  Processing by Devise::SessionsController#new as HTML
    ←[1m←[35mUser Load (3.0ms)←[0m  SELECT "users".* FROM "users" WHERE "users"."id" = 3 ORDER BY "users"."id" ASC LIMIT 1
  Redirected to http://localhost:3000/login
  Filter chain halted as :require_no_authentication rendered or redirected
  Completed 302 Found in 8ms (ActiveRecord: 3.0ms)
  </code></pre>
  
  <p>This is the code I have on my Application Controller:</p>
  
  <pre><code>  after_filter :store_location
  
    def store_location
      # store last url - this is needed for post-login redirect to whatever the user last visited.
      if (request.fullpath != "/users/sign_in" &amp;&amp;
          request.fullpath != "/users/sign_up" &amp;&amp;
          request.fullpath != "/users/password" &amp;&amp;
          !request.fullpath.match("/users") &amp;&amp;
          !request.xhr? &amp;&amp; # don't store ajax calls
          request.format == "text/html" || request.content_type == "text/html")
        session[:previous_url] = request.fullpath 
        session[:last_request_time] = Time.now.utc.to_i
      end
    end
  
    def after_sign_in_path_for(resource)
      session[:previous_url] || root_path
    end
  </code></pre>
  
  <p>Any idea why this is happening? Thanks</p>
  
  <p><strong>routes.rb</strong></p>
  
  <pre><code>Myapp::Application.routes.draw do
    ActiveAdmin.routes(self)
    devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; "users/omniauth_callbacks", :registrations =&gt; "registrations" }, :skip =&gt; [:sessions] 
    as :user do
      get 'login' =&gt; 'devise/sessions#new', :as =&gt; :new_user_session
      post 'login' =&gt; 'devise/sessions#create', :as =&gt; :user_session
      delete 'logout' =&gt; 'devise/sessions#destroy', :as =&gt; :destroy_user_session
    end
  
    root  'static_pages#home'
  </code></pre>
  
  <p><strong>devise.rb</strong></p>
  
  <pre><code>Devise.setup do |config|
    config.secret_key = ENV['DEVISE_SECRET_KEY']
  
    require 'devise/orm/active_record'
  
    # omniauth login
    require "omniauth-facebook"
    config.omniauth :facebook, ENV["APP_ID"], ENV["APP_SECRET"],
        {:scope =&gt; 'email, offline_access, user_events, friends_events', :client_options =&gt; {:ssl =&gt; {:ca_file =&gt; '/usr/lib/ssl/certs/ca-certificates.crt'}}} 
  
    # add username to login
    config.authentication_keys = [ :login ]
    config.reset_password_keys = [ :email ]
    config.confirmation_keys = [ :login ]
  
    config.case_insensitive_keys = [ :email ]
  
    config.strip_whitespace_keys = [ :email ]
  
    config.skip_session_storage = [:http_auth]
  
    config.stretches = Rails.env.test? ? 1 : 10
  
    config.reconfirmable = false
  
    config.password_length = 8..128
  
    config.reset_password_within = 6.hours
  
    config.sign_out_via = :delete
  end
  </code></pre>