{"action":"created","issue":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/1269","labels_url":"https://api.github.com/repos/keystonejs/keystone/issues/1269/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/keystone/issues/1269/comments","events_url":"https://api.github.com/repos/keystonejs/keystone/issues/1269/events","html_url":"https://github.com/keystonejs/keystone/issues/1269","id":65376836,"number":1269,"title":"Add custom validation for sign in","user":{"login":"ttsirkia","id":2797729,"avatar_url":"https://avatars.githubusercontent.com/u/2797729?v=3","gravatar_id":"","url":"https://api.github.com/users/ttsirkia","html_url":"https://github.com/ttsirkia","followers_url":"https://api.github.com/users/ttsirkia/followers","following_url":"https://api.github.com/users/ttsirkia/following{/other_user}","gists_url":"https://api.github.com/users/ttsirkia/gists{/gist_id}","starred_url":"https://api.github.com/users/ttsirkia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttsirkia/subscriptions","organizations_url":"https://api.github.com/users/ttsirkia/orgs","repos_url":"https://api.github.com/users/ttsirkia/repos","events_url":"https://api.github.com/users/ttsirkia/events{/privacy}","received_events_url":"https://api.github.com/users/ttsirkia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-31T06:16:56Z","updated_at":"2015-03-31T08:43:09Z","closed_at":null,"body":"The ready-made `signin` function is quite handy if you override the original login view. However, it might be a good idea to add here\r\n\r\n```javascript\r\nexports.signin = function(lookup, req, res, onSuccess, onFail) {\r\n```\r\n\r\nsixth parameter for a custom validation function which retrieves the `User` and returns `true` or `Error` object. For example, you might have a field for `accountLocked` and that should be checked when user logs in.\r\n\r\nI can make a PR if the idea sounds good."},"comment":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/comments/87997156","html_url":"https://github.com/keystonejs/keystone/issues/1269#issuecomment-87997156","issue_url":"https://api.github.com/repos/keystonejs/keystone/issues/1269","id":87997156,"user":{"login":"creynders","id":436347,"avatar_url":"https://avatars.githubusercontent.com/u/436347?v=3","gravatar_id":"","url":"https://api.github.com/users/creynders","html_url":"https://github.com/creynders","followers_url":"https://api.github.com/users/creynders/followers","following_url":"https://api.github.com/users/creynders/following{/other_user}","gists_url":"https://api.github.com/users/creynders/gists{/gist_id}","starred_url":"https://api.github.com/users/creynders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creynders/subscriptions","organizations_url":"https://api.github.com/users/creynders/orgs","repos_url":"https://api.github.com/users/creynders/repos","events_url":"https://api.github.com/users/creynders/events{/privacy}","received_events_url":"https://api.github.com/users/creynders/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T08:43:09Z","updated_at":"2015-03-31T08:43:09Z","body":"LOL. \r\n\r\n_If_ you're interested in tackling this, you should know I've extracted all hooking functionality from keystone into a separate module: [grappling-hook](https://github.com/keystonejs/grappling-hook) which you can use to add/call hooks. The documentation is pretty thorough, but I you need to know anything, let me know! Keystone v0.4 will use grappling-hook, i.e. in `master` it's not in use yet."}}