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 welcome#index if its the first time else it would be redirected to root_url.
The code that I have is has follow
class MysessionsController < 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 => after_sign_in_path_for(resource)
end
protected
def after_sign_up_path_for(resource)
"http://google.com"
end
end
I know I need to custom after_sign_up_path_for(resource) to what I want but I cant find how to determine if the user has sign in before or not with devise
after_sign_up_path_fordetermines what page the user is directed to after signing up, which will obviously be their first time logging in (since it is directly after signing up). - Logan Sermanafter_sign_up_path_forto a custom registrations controller (instead of sessions). Or even move it to ApplicationController. - Logan Serman