I use Rails 3.1, Devise and Omniauth.
The problem is that when facebook callbacks to my app
the url ends with #_. Then when in the callback action
I redirect to something – for example /after_signin
the redirect results in /after_signin#_.
Any idea how to remove this anchor from the URL?
EDIT:
It does not matter what I put in the callback function.
Even simple redirect:
class Users::OmniauthCallbacksController < ApplicationController
def facebook
redirect_to "/after_callback"
end
end
it would result in going to /after_callback#_
Even in normal controller if you go to /#_ and you have some redirect ther
it would get redirected to the specified path with #_ appended at the end.
EDIT2:
I just found out that it is the browser fault to preserve the anchor. So it has to be
handled in the frontend side.
If you’re confident that it’s a browser issue, you can just use JavaScript to update the
hashportion of thewindow‘slocationobject. Maybe something like this: