I'm having a bad experience with PassportJS running with Browser-sync. I'm using passport-Auth0 with my expressjs application. My app runs on localhost:1337. Browser-sync proxies that and runs its version on localhost:3000. So when I navigate to localhost:1337, authentication works fine. On localhost:3000, it fails, though I could just authenticate myself on localhost:3000, and I find myself authenticated on localhost:3000 fine.
But browser-sync also runs my application externally. It's on http://10.18.xxx.xxx:3000. This is good since I can test it on my iPad. But when I try to authenticate myself on my iPad, I receive two errors. On the server, I receive this error (which is the same as if I'm authenticating myself on localhost:3000):
The redirect URI is wrong. You send http://localhost:1337, and we expected http://10.18.xxx.xxx:3000
And on the front-end, it gives me a server 500 error saying:
TokenError: The redirect URI is wrong. You send //10.18.xxx.xxx:3000, and we expected http://10.18.xxx.xxx:3000
This happens while I'm already authenticated on localhost:1337 and localhost:3000.
via AskYous
No comments:
Post a Comment