How to logout the facebook using django-allauth? [closed]

老子叫甜甜 提交于 2019-12-13 11:27:27

问题


I am new to django-allauth. I have successfully login from facebook using djang0-allauth. But I try to logout using '/accounts/logout'. It is also successfully logged out my application. But my problem is at the same time facebook not logged out(i.e; facebook not session expired.). Please solve my problem. Thanks...


回答1:


This is actually normal/accepted behavior. For example, take stackoverflow. Signing out there does not sign you out of e.g. your Google account. Or, signing in with Twitter on digg.com, then signing out does not sign you out from Twitter.

Update

I decided to make this a bit easier to do. Simply invoke window.allauth.facebook.logout(). This is new (yet to be released) functionality, committed here:

https://github.com/pennersr/django-allauth/commit/0f9fa49deb9ad95764e2cc8135576280ada17043




回答2:


I solved my issue. using following script

function logout_social() {

   FB.logout(function(response) {  // for facebook logout
  window.location.href = '/logout' // for my app logout
});
}

In html file

{% load socialaccount %} 
{% providers_media_js %} // for facebook plugins


来源:https://stackoverflow.com/questions/17022609/how-to-logout-the-facebook-using-django-allauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!