{"action":"created","issue":{"url":"https://api.github.com/repos/NodeBB/NodeBB/issues/4157","repository_url":"https://api.github.com/repos/NodeBB/NodeBB","labels_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/4157/labels{/name}","comments_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/4157/comments","events_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/4157/events","html_url":"https://github.com/NodeBB/NodeBB/issues/4157","id":131575339,"number":4157,"title":"Hook Request :: controllers/authentication :: filter:register.beforeLogin","user":{"login":"lots0logs","id":4675662,"avatar_url":"https://avatars.githubusercontent.com/u/4675662?v=3","gravatar_id":"","url":"https://api.github.com/users/lots0logs","html_url":"https://github.com/lots0logs","followers_url":"https://api.github.com/users/lots0logs/followers","following_url":"https://api.github.com/users/lots0logs/following{/other_user}","gists_url":"https://api.github.com/users/lots0logs/gists{/gist_id}","starred_url":"https://api.github.com/users/lots0logs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lots0logs/subscriptions","organizations_url":"https://api.github.com/users/lots0logs/orgs","repos_url":"https://api.github.com/users/lots0logs/repos","events_url":"https://api.github.com/users/lots0logs/events{/privacy}","received_events_url":"https://api.github.com/users/lots0logs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NodeBB/NodeBB/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-02-05T07:25:21Z","updated_at":"2016-02-14T06:43:37Z","closed_at":"2016-02-10T20:26:17Z","body":"### Use Case\r\nMake it possible to prevent automatic login after successful registration. This would help me prevent spam bots from being able to post in our forum (since we're not using local login and instead use SSO only). Though now it just occurred to me that the fact they are logged in automatically when local login is disabled is probably a bug :question: "},"comment":{"url":"https://api.github.com/repos/NodeBB/NodeBB/issues/comments/183836744","html_url":"https://github.com/NodeBB/NodeBB/issues/4157#issuecomment-183836744","issue_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/4157","id":183836744,"user":{"login":"lots0logs","id":4675662,"avatar_url":"https://avatars.githubusercontent.com/u/4675662?v=3","gravatar_id":"","url":"https://api.github.com/users/lots0logs","html_url":"https://github.com/lots0logs","followers_url":"https://api.github.com/users/lots0logs/followers","following_url":"https://api.github.com/users/lots0logs/following{/other_user}","gists_url":"https://api.github.com/users/lots0logs/gists{/gist_id}","starred_url":"https://api.github.com/users/lots0logs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lots0logs/subscriptions","organizations_url":"https://api.github.com/users/lots0logs/orgs","repos_url":"https://api.github.com/users/lots0logs/repos","events_url":"https://api.github.com/users/lots0logs/events{/privacy}","received_events_url":"https://api.github.com/users/lots0logs/received_events","type":"User","site_admin":false},"created_at":"2016-02-14T06:43:36Z","updated_at":"2016-02-14T06:43:36Z","body":"@julianlam It doesn't work :expressionless: Here's what I have in the plugin:\r\n```\r\n\"hooks\": [\r\n\t\t{ \"hook\": \"static:app.load\", \"method\": \"init\" },\r\n\t\t{ \"hook\": \"filter:auth.init\", \"method\": \"getStrategy\" },\r\n\t\t{ \"hook\": \"filter:auth.list\", \"method\": \"getAssociation\" },\r\n\t\t{ \"hook\": \"filter:admin.header.build\", \"method\": \"addMenuItem\" },\r\n\t\t{ \"hook\": \"filter:user.delete\", \"method\": \"deleteUserData\" },\r\n\t\t{\"hook\": \"filter:register.check\", \"method\": \"noLoginAfterRegister\"}\r\n\t]\r\n```\r\n```javascript\r\nAuth0.noLoginAfterRegister = function(params, callback) {\r\n\t\tparams.res.locals.processLogin = false;\r\n\t\tcallback(null, params);\r\n\t};\r\n```\r\nI also tried this...\r\n```javascript\r\nAuth0.noLoginAfterRegister = function(params, callback) {\r\n\t\tparams.res.locals.processLogin = false;\r\n\t\tsetTimeout(function() {\r\n\t\t\tcallback(null, params);\r\n\t\t}, 1500);\r\n\t};\r\n```"}}