Already logged in on Facebook, why the need to re-authenticate when using Devise

82 Views Asked by At

I am using Devise and omniauth-facebook gem. I have successfully configured it. However, I wonder why I need to re-authenticate when I click the sign-in link in my app, when I am already logged in on Facebook on another tab in my browser? Shouldn't it be some magic here? Or is that expected behaviour?

2

There are 2 best solutions below

1
On

As it turns out using this method:

<%= link_to 'Sign in', volunteer_omniauth_authorize_path(:facebook) %>

It works as expected. When a user is logged in to Facebook he/she does not have to reenter authentication information. When signing out of Facebook the user has to reauthenticate.

Awesome.

1
On

It's expected. That's facebook's way of making sure you a user is actually trying to give someone access to their information.