{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-component-passport/issues/174","repository_url":"https://api.github.com/repos/strongloop/loopback-component-passport","labels_url":"https://api.github.com/repos/strongloop/loopback-component-passport/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-component-passport/issues/174/comments","events_url":"https://api.github.com/repos/strongloop/loopback-component-passport/issues/174/events","html_url":"https://github.com/strongloop/loopback-component-passport/issues/174","id":173116549,"number":174,"title":"link is not working. Always req.user undefined!","user":{"login":"ahmed-abdulmoniem","id":6064145,"avatar_url":"https://avatars.githubusercontent.com/u/6064145?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmed-abdulmoniem","html_url":"https://github.com/ahmed-abdulmoniem","followers_url":"https://api.github.com/users/ahmed-abdulmoniem/followers","following_url":"https://api.github.com/users/ahmed-abdulmoniem/following{/other_user}","gists_url":"https://api.github.com/users/ahmed-abdulmoniem/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmed-abdulmoniem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmed-abdulmoniem/subscriptions","organizations_url":"https://api.github.com/users/ahmed-abdulmoniem/orgs","repos_url":"https://api.github.com/users/ahmed-abdulmoniem/repos","events_url":"https://api.github.com/users/ahmed-abdulmoniem/events{/privacy}","received_events_url":"https://api.github.com/users/ahmed-abdulmoniem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-25T05:24:05Z","updated_at":"2016-08-26T19:43:08Z","closed_at":null,"body":"Hi Guys,\r\n\r\nAny clue on this discussion\r\n\r\nhttps://groups.google.com/forum/#!msg/loopbackjs/JGPmOiwWr2U/PkJF3KkMWkMJ\r\n\r\nI created the LoopBack user, logged in, and then tried `/link/facebook`. Upon successful Facebook login, I got the profile returned. However, the `req.user` is undefined, and I got `done('No user is logged in')` at line `297` of `passport-configurator.js`. Any idea why the `user` is not there?\r\n\r\n`loopback-component-passport/lib/passport-configurator.js:`\r\n\r\n```\r\n292          if (link) {\r\n293            if (req.user) {\r\n294              self.userCredentialModel.link(req.user.id, name, authScheme, profile,\r\n295                {accessToken: accessToken, refreshToken: refreshToken}, options, done);\r\n296            } else {\r\n297              done('No user is logged in');\r\n298            }\r\n```\r\n\r\nAlso, I have tried to call `/link/facebook` by passing the loopback token with the link like that `/link/facebook?access_token=###` and still the same!!\r\n\r\nAny clue?"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-component-passport/issues/comments/242832525","html_url":"https://github.com/strongloop/loopback-component-passport/issues/174#issuecomment-242832525","issue_url":"https://api.github.com/repos/strongloop/loopback-component-passport/issues/174","id":242832525,"user":{"login":"ahmed-abdulmoniem","id":6064145,"avatar_url":"https://avatars.githubusercontent.com/u/6064145?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmed-abdulmoniem","html_url":"https://github.com/ahmed-abdulmoniem","followers_url":"https://api.github.com/users/ahmed-abdulmoniem/followers","following_url":"https://api.github.com/users/ahmed-abdulmoniem/following{/other_user}","gists_url":"https://api.github.com/users/ahmed-abdulmoniem/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmed-abdulmoniem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmed-abdulmoniem/subscriptions","organizations_url":"https://api.github.com/users/ahmed-abdulmoniem/orgs","repos_url":"https://api.github.com/users/ahmed-abdulmoniem/repos","events_url":"https://api.github.com/users/ahmed-abdulmoniem/events{/privacy}","received_events_url":"https://api.github.com/users/ahmed-abdulmoniem/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T19:43:08Z","updated_at":"2016-08-26T19:43:08Z","body":"@raymondfeng ?"}}
{"actor":{"display_login":"ahmed-abdulmoniem"}}