title: devise first login with rails
body: <p>How can I determine on my custom session controller that the user is the first time login, I want to be able to create a session and to redirect to <code>welcome#index</code> if its the first time else it would be redirected to <code>root_url</code>.</p>
  
  <p>The code that I have is has follow</p>
  
  <pre><code>class MysessionsController &lt; Devise::SessionsController
    def create
      self.resource = warden.authenticate!(auth_options)
      set_flash_message(:notice, :signed_in) if is_navigational_format?
      sign_in(resource_name, resource)
      respond_with resource, :location =&gt; after_sign_in_path_for(resource)    
    end
    protected
    def after_sign_up_path_for(resource)
      "http://google.com"
  
    end 
  end
  </code></pre>
  
  <p>I know I need to custom <code>after_sign_up_path_for(resource)</code> to what I want but I cant find how to determine if the user has sign in before or not with devise</p>