3

I am using python-social-auth and django in my authentication system.

At the moment, when I authenticate with either Facebook or Google, the URL returns with either /#_=_ or /# appended. I understand that these are deliberate but I'd like to remove them.

I've seen a number of javascript solutions for the facebook version, but I'd like to do this from the server side.

I tried to do a basic redirect:

def pre_home(request):
   return redirect(reverse('home'))

def home(request):
   return render(request, 'core/home.html)

where I directed the auth system to pre_home on completion. I assumed this would strip off the end of the url on redirection to home, however it does not...

Rob
  • 617
  • 8
  • 21
  • It's the browser that is persisting the hash, not the server. All you can do on the server is replace the anchor with an empty one, e.g. `return redirect(reverse('home'))+'#' `. See [this question](https://stackoverflow.com/questions/5283395/url-hash-is-persisting-between-redirects). – Alasdair Oct 15 '17 at 12:15
  • OK - is there no way to force the browser to refresh without the # somehow? – Rob Oct 15 '17 at 12:39

0 Answers0