The answer to 1 is pretty simple: just add an if path to the omniauth_callbacks_controller :: process_callback method like this
# If a user is signed in then he is trying to link a new account if user_signed_in? if authentication.persisted?
This is what I do in my application and it works great.
As for question 2, I don’t know how to support two different facebook authentication configurations, but it’s hard for me to understand how this is useful for users, because they need consistent experience in both ways: “Log in using facebook” and “connect your facebook account. " (If you still want to continue this path, one of the ideas I would like to explore is to create a new facebook application with its independent keys and configuration ...)
I hope for this help.
source share