2

I have a project using jQuery Mobile (uses resource identifier heavily) with Facebook authentication. Recently Facebook started adding #_=_ to callbacks (see here). This is killing jQuery Mobile.

Is it possible to do an automatic redirect for any routes matching #_=_ to the stripped counterpart? Is it possible to specify a resource identifier (#) when doing a redirect to? Any other possible fixes? I currently use a javascript redirect but this causes duplicate page loads and issues with some of the analytics.

Community
  • 1
  • 1
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232

1 Answers1

1

Added in the following work around until Facebook fixes it (seems to work):

# app/controllers/omniauth_controller.rb

def create
  ...
  js_redirect_to(user_path)
end

private

def js_redirect_to(path)
  @location = path
  render "shared/redirect"
end

# app/views/shared/redirect.html.haml

:javascript
  window.location = '#{@location}'
Kevin Sylvestre
  • 37,288
  • 33
  • 152
  • 232