Closed maael closed 8 years ago
Thanks for reporting the issue. I suspect a JWT token is not getting sent in the Authorization header.
Is this behavior happening in production or development?
There seems be the issue: https://github.com/github/fetch#caveats
By default, fetch does not send cookies, which explains why req.cookies
is empty during POST /auth/facebook or /auth/google.
Let me see if setting credentials: 'same-origin'
fixes the issue.
Thanks for the fix!
Behaviour
When you try to link two accounts in a project generated with the react js framework, a new account is made instead.
Background
This seems to be done because the
req.isAuthenticated()
call at https://git.io/vKTk6 fails, and https://git.io/vKTk1 will also fail to find a user as this is the first time the account for the chosen service has been seen, so a new account is made.It appears that https://git.io/vKTkN has the token set as undefined, as the token can't be found in the cookies at that point for some reason.
Expected Behaviour
It would be expected that
req.isAuthenticated()
check should pass, and the new service added the user on thereq
, linking the new account to the current account.