how to logout from both facebook and devise

I have the following scenario:

  • User logs in with Facebook connect (devise, omniauth)
  • User starts browsing around the site
  • User logs out from Facebook
  • User can still browse around. <-- how can I prevent this from happening?

Update:

I followed gist.github.com/848721 but still i cannot solve

Answers


You can redirect user to facebook logout page with access token.

redirect_to "https://www.facebook.com/logout.php?next=#{YOUR_REDIRECT_URL}&access_token=#{USER_ACCESS_TOKEN}"

You can integrate with devise like that:

controllers/application_controller.rb

def after_sign_out_path_for(resource_or_scope)
  "https://www.facebook.com/logout.php?next=#{YOUR_REDIRECT_URL}&access_token=#{USER_ACCESS_TOKEN}"
end

Need Your Help

How to populate multiple foreign keys in mongoose

node.js mongodb mongoose populate

Lets say I have and object reference already set for the ids in userId:

Currency format input values in ZF2 Doctrine

php doctrine2 zend-framework2

When I save a form I can automatically format the value with an inputfilter. Is this also possible when I hydrate a form to edit the object?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.