dimanche 7 janvier 2018

Firebase hosting with reactjs cannot handle /redirect from third party authentication

I am new to reactjs and Firebase web hosting.

I am using Sketchfab OAuth2 for my web. So, I need to provide a redirect link to Sketchfab, e.g. http://ift.tt/2m3RmSk

However, I am using react-router and no matter what pages I routed to, there is a '#' in the url, e.g. http://ift.tt/2CQahub and http://ift.tt/2m3RnFS. This makes me cannot get the OAuth token from Sketchfab because my url and the redirect url are not match.

I have requested to use http://ift.tt/2m3RnFS as the redirect url. However, Sketchfab does not support having '#' in the redirect url.

Possible solution to this problem:

  1. Find a way to remove the '#' from my url
  2. Make use of firebase.json to rewrite the destination of all **/redirect/** source to the http://ift.tt/2m3RnFS

For option 2, I don't know how to do this in reactjs since I only know how to rewrite the destination to a html file, e.g. /index.html

Aucun commentaire:

Enregistrer un commentaire