{"action":"created","issue":{"url":"https://api.github.com/repos/tjwebb/sails-auth/issues/35","labels_url":"https://api.github.com/repos/tjwebb/sails-auth/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/tjwebb/sails-auth/issues/35/comments","events_url":"https://api.github.com/repos/tjwebb/sails-auth/issues/35/events","html_url":"https://github.com/tjwebb/sails-auth/issues/35","id":67040829,"number":35,"title":"Missing Login method in the Local Callback","user":{"login":"scott-wyatt","id":4590417,"avatar_url":"https://avatars.githubusercontent.com/u/4590417?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-wyatt","html_url":"https://github.com/scott-wyatt","followers_url":"https://api.github.com/users/scott-wyatt/followers","following_url":"https://api.github.com/users/scott-wyatt/following{/other_user}","gists_url":"https://api.github.com/users/scott-wyatt/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-wyatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-wyatt/subscriptions","organizations_url":"https://api.github.com/users/scott-wyatt/orgs","repos_url":"https://api.github.com/users/scott-wyatt/repos","events_url":"https://api.github.com/users/scott-wyatt/events{/privacy}","received_events_url":"https://api.github.com/users/scott-wyatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tjwebb","id":1009114,"avatar_url":"https://avatars.githubusercontent.com/u/1009114?v=3","gravatar_id":"","url":"https://api.github.com/users/tjwebb","html_url":"https://github.com/tjwebb","followers_url":"https://api.github.com/users/tjwebb/followers","following_url":"https://api.github.com/users/tjwebb/following{/other_user}","gists_url":"https://api.github.com/users/tjwebb/gists{/gist_id}","starred_url":"https://api.github.com/users/tjwebb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjwebb/subscriptions","organizations_url":"https://api.github.com/users/tjwebb/orgs","repos_url":"https://api.github.com/users/tjwebb/repos","events_url":"https://api.github.com/users/tjwebb/events{/privacy}","received_events_url":"https://api.github.com/users/tjwebb/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-04-08T03:33:10Z","updated_at":"2015-04-09T04:19:41Z","closed_at":null,"body":"I'm having an issue trying to use login. I would just add this in and do a PR, but I am really bad at doing the testing stuff. I think this is what it should look like... perhaps I'm wrong?\r\n\r\n```js\r\ncallback: function (req, res, next) {\r\n    var provider = req.param('provider', 'local');\r\n    var action = req.param('action');\r\n\r\n    // Passport.js wasn't really built for local user registration, but it's nice\r\n    // having it tied into everything else.\r\n    if (provider === 'local' && action !== undefined) {\r\n      if (action === 'register' && !req.user) {\r\n        this.protocols.local.register(req, res, next);\r\n      }\r\n      else if (action === 'login' && !req.user) {\r\n        this.protocols.local.login(req, res, next);\r\n      }\r\n      else if (action === 'connect' && req.user) {\r\n        this.protocols.local.connect(req, res, next);\r\n      }\r\n      else if (action === 'disconnect' && req.user) {\r\n        this.protocols.local.disconnect(req, res, next);\r\n      }    \r\n      else {\r\n        next(new Error('Invalid action'));\r\n      }\r\n    } else {\r\n      if (action === 'disconnect' && req.user) {\r\n        this.disconnect(req, res, next) ;\r\n      } else {\r\n        // The provider will redirect the user to this URL after approval. Finish\r\n        // the authentication process by attempting to obtain an access token. If\r\n        // access was granted, the user will be logged in. Otherwise, authentication\r\n        // has failed.\r\n        this.authenticate(provider, next)(req, res, req.next);\r\n      }\r\n    }\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/tjwebb/sails-auth/issues/comments/91111665","html_url":"https://github.com/tjwebb/sails-auth/issues/35#issuecomment-91111665","issue_url":"https://api.github.com/repos/tjwebb/sails-auth/issues/35","id":91111665,"user":{"login":"scott-wyatt","id":4590417,"avatar_url":"https://avatars.githubusercontent.com/u/4590417?v=3","gravatar_id":"","url":"https://api.github.com/users/scott-wyatt","html_url":"https://github.com/scott-wyatt","followers_url":"https://api.github.com/users/scott-wyatt/followers","following_url":"https://api.github.com/users/scott-wyatt/following{/other_user}","gists_url":"https://api.github.com/users/scott-wyatt/gists{/gist_id}","starred_url":"https://api.github.com/users/scott-wyatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scott-wyatt/subscriptions","organizations_url":"https://api.github.com/users/scott-wyatt/orgs","repos_url":"https://api.github.com/users/scott-wyatt/repos","events_url":"https://api.github.com/users/scott-wyatt/events{/privacy}","received_events_url":"https://api.github.com/users/scott-wyatt/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T04:19:41Z","updated_at":"2015-04-09T04:19:41Z","body":"Oh snap @bgulotta thanks man, I'll give it a go."}}