How do I tell which authentication user is using in rails (OmniAuth)
-
11-10-2019 - |
Question
Suppose user can login using either Facebook Account or OpenId. If user uses Facebook, I would like to put a button like publish on my homepage, else I will not put anything on it. How do I tell which authentication method user is using in OmniAuth?
Solution
In your callback method, you can access the request.env["omniauth.auth"]["provider"] varaible to determine if he used Facebook vs. OpenID.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow