DEV Community

Discussion on: SailsJS - use Passport to Login with Facebook

Collapse
rhobur profile image
Robertino Vasilescu

Hi Christian,
I was testing this on a real domain with CORS enabled and there is an this error:
"Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource." although the CORS allow origin is set up for the sails app.
It looks like we need to add the headers for this to work.
I'll too have a deeper look tomorrow.

Thread Thread
christianstrang profile image
christianstrang Author

Maybe take a look at production.js and add the allowed origin to the cors object? Let me know if this solves the issue :)

Thread Thread
rhobur profile image
Robertino Vasilescu

It was already set like that; I did not have the time yet but I am planning to look at it again later today.

Thread Thread
numantz profile image
numantz

Hey Christian,

Thank you for your tutorial. I have tried to use your example but I am having some strange issues and cannot get things to work. Did you have any issues with skipper or did you do any other changes to sails configuration? I get some loopy behavior ;D the callback is being called over and over again until the browser rejects due to too many redirects. I havent been able to get the user details from fb even though I can see the ?code="xxx" param from fb to my callback route. Any insight would be appreciated! Robertino you are experienced with sails and have helped me in stack in the past, maybe you have any idea on the issue! :)