How to get rid of the #_=_ in the facebook redirect of django-social-auth?

django, django-socialauth, facebook

Solution

Well, this may not be the exact solution, but adding following script to you head would help in fixing the problem:

<script type="text/javascript">
   if (window.location.hash == '#_=_') {
      window.location.hash = '';
   }
</script>

Problem

django-social-auth redirects me to `/mypage#_=_` when using the the Facebook backend. As I am working with jquery mobile on the front end, I can not accept that. I found: https://developers.facebook.com/blog/post/552/ on the facebook developers site. Change in Session Redirect Behavior This week, we started adding a fragment #_=_ to the redirect_uri when this field is left blank. Please ensure that your app can handle this behavior. So I tried settung `SOCIAL_AUTH_LOGIN_REDIRECT_URL` in the django-social-auth settings to something 'none blank'. No luck So, how to I get rid of the hash thing? Thanks a lot!

Original source