0

I see plenty of others have had issues with facebook appending this to the callback uri and saw some good solutions for handling this client side with js embedded in the page. I have a nodejs api that handles the actual authorization with passportjs and passes it to our frontend (nuxtjs based on vue 2). The client stalls when trying to access/redirect any routes after being sent to the uri with the appended

I was hoping I could fix it with

//dashboard.vue
mount(){
    if (window.location.hash == "#_=_"){
      window.location.hash = ''
    }
  }

but this doesn't seem to fix anything with the router. I also tried adding a redirect to the vue router

//.nuxt/router.js
{ path: "/dashboard#_=_", redirect: "/dashboard" }

but the vue router dynamically generates on runtime so anything I hard-code there gets undone.

From what I undestand this is strictly a client side problem, but maybe I'm missing some parameter in the Facebook API call that could prevent this?

//backend api calling fb api
app.get('/facebook', passport.authenticate('facebook')) //not specifying scope since still in dev and haven't applied for approval
  • 1
    _"but maybe I'm missing some parameter in the Facebook API call that could prevent this?"_ - no you are not, because this gets deliberately added to increase security. https://stackoverflow.com/a/41917323/1427878 – CBroe Mar 25 '22 at 14:43

0 Answers0