{"action":"created","issue":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/1378","labels_url":"https://api.github.com/repos/keystonejs/keystone/issues/1378/labels{/name}","comments_url":"https://api.github.com/repos/keystonejs/keystone/issues/1378/comments","events_url":"https://api.github.com/repos/keystonejs/keystone/issues/1378/events","html_url":"https://github.com/keystonejs/keystone/pull/1378","id":74633131,"number":1378,"title":"Extra hooks: `updates`, `signin` and `signout`","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},"labels":[{"url":"https://api.github.com/repos/keystonejs/keystone/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-09T09:28:17Z","updated_at":"2015-05-12T07:07:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/keystonejs/keystone/pulls/1378","html_url":"https://github.com/keystonejs/keystone/pull/1378","diff_url":"https://github.com/keystonejs/keystone/pull/1378.diff","patch_url":"https://github.com/keystonejs/keystone/pull/1378.patch"},"body":"I added 3 new hooks:\r\n\r\n* `updates`\r\n* `signin` (see #1269)\r\n* `signout`\r\n\r\nSome things of note: (will update docs in a separate PR BTW)\r\n\r\n* `signin` middleware is executed in the user object scope, i.e. `this` refers to the user object. It means the `pre:signin` middleware are executed _after_ pasword verification. TBH @ttsirkia it _is_ a bit weird though, if the user enters a wrong password the `signin` middleware isn't called, which is **really** odd IMO.\r\n    @dcousens and @jedwatson what do you guys think?\r\n* Had to modify `views/signin` too, since it always outputs \"Sorry, that email and password combo are not valid.\" if an error occurs, which is no longer appropriate.\r\n"},"comment":{"url":"https://api.github.com/repos/keystonejs/keystone/issues/comments/101162042","html_url":"https://github.com/keystonejs/keystone/pull/1378#issuecomment-101162042","issue_url":"https://api.github.com/repos/keystonejs/keystone/issues/1378","id":101162042,"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-05-12T07:07:06Z","updated_at":"2015-05-12T07:07:06Z","body":">Absolutely, if anyone relied on the sign-in being synchronous, this could become a large security floor in their application.\r\n\r\n@dcousens Sorry, should've added a comment that this is no longer the case (was a comment to an outdated commit). The hooks wrap the \"normal\" `signin` now and no longer `signinWithUser`, in fact if you use `signinWithUser` directly no hooks are called at all, which means this is stil synced. The \"normal\" signin is always async anyway, so nothing changes in that case. I.e. there's no real reason to postpone to v0.4"}}