Omniauth and Facebook’s #_+_

I’m in the process of implementing a new review system for and am using Omniauth to allow users to sign on via their Facebook account. All is happy and well, but there is a known issue with Facebook where they append ‘#_+_’ to url’s when redirecting a user back to your application.

Being foolish stubborn, I attempted various work-arounds for this one… up to and including nginx re-writes, rack middleware, and cursing. In the end, the functioning work-around is to follow the advice at stackoverflow and reset the hash via javascript:

window.location.hash = ""

As such in my implementation, I have set an instance variable to determine if the user is being redirected from Facebook, and redirecting them upon page load to a new page where the #_+_ doesn’t totally tank my JS:

<% if @show_review -%>
if(window.location.hash.length > 0){
window.location.hash = '';
window.location.href = "<%= @product.url %>?review=1";
<% end %>

Ghetto, hack, ugh.

81 thoughts on “Omniauth and Facebook’s #_+_”

  1. Pingback: propecia
  2. Pingback: lunette ray ban
  3. Pingback: garnicia cambogia
  4. Pingback: link
  5. Pingback: Check This Out
  6. Pingback: Click On this site
  7. Pingback: More suggestions
  8. Pingback: Read A lot more
  9. Pingback: relevant site
  10. Pingback: similar website
  11. Pingback: Recommended Site
  12. Pingback: related website
  13. Pingback: relevant webpage
  14. Pingback: simply click
  15. Pingback: Extra resources
  16. Pingback: Full Survey
  17. Pingback: stay with me
  18. Pingback: Get More Info
  19. Pingback: Suggested Webpage
  20. Pingback: home-page
  21. Pingback: Suggested Web page
  22. Pingback: this website
  23. Pingback: Check This Out
  24. Pingback: More Support
  25. Pingback: relevant web-site
  26. Pingback: similar web site
  27. Pingback: Read More
  28. Pingback: Read the Full Post
  29. Pingback: Extra resources

Leave a Reply