After testing, we found that Devise sets the value sign_in_countimmediately after logging in, which means that it will never be 0, it will be 1for logging in:
devise_for :users, controllers: { sessions: "sessions" }
class SessionController < Devise::DeviseController
def after_sign_in_path_for(resource)
if resource.sign_in_count == 1
welcome_path
else
root_path
end
end
end
source
share