if @user.persisted?
sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated
set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format?
else
session["devise.facebook_data"] = request.env["omniauth.auth"]
redirect_to new_user_registration_url
end
This method is present in the facebook omniauth callbacks controller
. The problem that I am facing is that I do not get the user's phone number from facebook and thus @user
is not a valid object (I have a validation
). So, I want to redirect the user to another page where I can ask for the phone number.
How can I modify the sign_in_and_redirect @user to redirect me to that page and not the root url.