{"action":"created","comment":{"url":"https://api.github.com/repos/loklak/loklak_walls/pulls/comments/67035565","id":67035565,"diff_hunk":"@@ -1,47 +1,82 @@\n var express = require('express');\n var router = express.Router();\n var passport = require('passport');\n-var jwt = require('express-jwt');\n var config = require('../../custom_configFile.json');\n \n-var auth = jwt({\n-  secret: config.jwtsecret,\n-  userProperty: 'payload'\n-});\n-\n var ctrlProfile = require('../controllers/profile');\n var ctrlAuth = require('../controllers/authentication');\n var ctrlMailer = require('../controllers/email');\n var ctrlWalls = require('../controllers/walls');\n \n-// profile\n-// router.get('/profile', auth, ctrlProfile.profileRead);\n+// AUTH ================================\n+router.post('/register', function(req,res,next){\n+\tpassport.authenticate('local-signup',function(err, user, info){\n+\t\tif (err) { return next(err); }\n+\t\tif (!user) { console.log(\"info\", info);\n+\t\t \tres.json(info); \n+\t\t}\n+\t\treq.login(user, function(err) {\n+\t\t\tif (err) { return next(err); }\n+\t\t\tres.json(user);\n+\t\t})\n+\t})(req, res);\n+});\n+router.post('/login', function(req,res,next){\n+\tpassport.authenticate('local-login',function(err, user, info){\n+\t\treq.login(user, function(err) {\n+\t\t\tif (err) { return next(err); }\n+\t\t\tif(!user) res.json(info);","path":"mongo/routes/index.js","position":36,"original_position":36,"commit_id":"06a36dcda2f6e68e50410d953785f4a8ca9ddae2","original_commit_id":"06a36dcda2f6e68e50410d953785f4a8ca9ddae2","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Expected '{' and instead saw 'res'.","created_at":"2016-06-14T19:03:40Z","updated_at":"2016-06-14T19:03:40Z","html_url":"https://github.com/loklak/loklak_walls/pull/5#discussion_r67035565","pull_request_url":"https://api.github.com/repos/loklak/loklak_walls/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/loklak/loklak_walls/pulls/comments/67035565"},"html":{"href":"https://github.com/loklak/loklak_walls/pull/5#discussion_r67035565"},"pull_request":{"href":"https://api.github.com/repos/loklak/loklak_walls/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/loklak/loklak_walls/pulls/5","id":73795444,"html_url":"https://github.com/loklak/loklak_walls/pull/5","diff_url":"https://github.com/loklak/loklak_walls/pull/5.diff","patch_url":"https://github.com/loklak/loklak_walls/pull/5.patch","issue_url":"https://api.github.com/repos/loklak/loklak_walls/issues/5","number":5,"state":"open","locked":false,"title":"Added twitter login and linking to local accounts","user":{"login":"leonmak","id":13071508,"avatar_url":"https://avatars.githubusercontent.com/u/13071508?v=3","gravatar_id":"","url":"https://api.github.com/users/leonmak","html_url":"https://github.com/leonmak","followers_url":"https://api.github.com/users/leonmak/followers","following_url":"https://api.github.com/users/leonmak/following{/other_user}","gists_url":"https://api.github.com/users/leonmak/gists{/gist_id}","starred_url":"https://api.github.com/users/leonmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonmak/subscriptions","organizations_url":"https://api.github.com/users/leonmak/orgs","repos_url":"https://api.github.com/users/leonmak/repos","events_url":"https://api.github.com/users/leonmak/events{/privacy}","received_events_url":"https://api.github.com/users/leonmak/received_events","type":"User","site_admin":false},"body":"Changed the auth method from JWT to sessions as\r\nI had trouble integrating JWT with twitter passport\r\nstrategies\r\n\r\nFixes #3 ","created_at":"2016-06-14T19:03:29Z","updated_at":"2016-06-14T19:03:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fa0538dbf09cac1bd119adbac5691cec7eaf576","assignee":{"login":"leonmak","id":13071508,"avatar_url":"https://avatars.githubusercontent.com/u/13071508?v=3","gravatar_id":"","url":"https://api.github.com/users/leonmak","html_url":"https://github.com/leonmak","followers_url":"https://api.github.com/users/leonmak/followers","following_url":"https://api.github.com/users/leonmak/following{/other_user}","gists_url":"https://api.github.com/users/leonmak/gists{/gist_id}","starred_url":"https://api.github.com/users/leonmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonmak/subscriptions","organizations_url":"https://api.github.com/users/leonmak/orgs","repos_url":"https://api.github.com/users/leonmak/repos","events_url":"https://api.github.com/users/leonmak/events{/privacy}","received_events_url":"https://api.github.com/users/leonmak/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/loklak/loklak_walls/milestones/1","html_url":"https://github.com/loklak/loklak_walls/milestones/GSOC%202016%20Milestone%205%20(Midterm%20Evaluation)","labels_url":"https://api.github.com/repos/loklak/loklak_walls/milestones/1/labels","id":1824836,"number":1,"title":"GSOC 2016 Milestone 5 (Midterm Evaluation)","description":"GSOC 2016 Milestone 5 - All issues to be completed by 19th June 2016.\r\n\r\nInstructions: \r\n1. Create issues to work on.\r\n2. Assign the issue to the milestone.\r\n3. Assign the issue to a user (yourself)\r\n\r\nCompleted Milestone:\r\n1. Create a blog post describing what has been done\r\n2. Tag a release\r\n3. Deployment","creator":{"login":"leonmak","id":13071508,"avatar_url":"https://avatars.githubusercontent.com/u/13071508?v=3","gravatar_id":"","url":"https://api.github.com/users/leonmak","html_url":"https://github.com/leonmak","followers_url":"https://api.github.com/users/leonmak/followers","following_url":"https://api.github.com/users/leonmak/following{/other_user}","gists_url":"https://api.github.com/users/leonmak/gists{/gist_id}","starred_url":"https://api.github.com/users/leonmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonmak/subscriptions","organizations_url":"https://api.github.com/users/leonmak/orgs","repos_url":"https://api.github.com/users/leonmak/repos","events_url":"https://api.github.com/users/leonmak/events{/privacy}","received_events_url":"https://api.github.com/users/leonmak/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2016-06-14T01:31:05Z","updated_at":"2016-06-14T19:03:29Z","due_on":"2016-06-18T16:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/loklak/loklak_walls/pulls/5/commits","review_comments_url":"https://api.github.com/repos/loklak/loklak_walls/pulls/5/comments","review_comment_url":"https://api.github.com/repos/loklak/loklak_walls/pulls/comments{/number}","comments_url":"https://api.github.com/repos/loklak/loklak_walls/issues/5/comments","statuses_url":"https://api.github.com/repos/loklak/loklak_walls/statuses/06a36dcda2f6e68e50410d953785f4a8ca9ddae2","head":{"label":"leonmak:ConnectSocialAcct","ref":"ConnectSocialAcct","sha":"06a36dcda2f6e68e50410d953785f4a8ca9ddae2","user":{"login":"leonmak","id":13071508,"avatar_url":"https://avatars.githubusercontent.com/u/13071508?v=3","gravatar_id":"","url":"https://api.github.com/users/leonmak","html_url":"https://github.com/leonmak","followers_url":"https://api.github.com/users/leonmak/followers","following_url":"https://api.github.com/users/leonmak/following{/other_user}","gists_url":"https://api.github.com/users/leonmak/gists{/gist_id}","starred_url":"https://api.github.com/users/leonmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonmak/subscriptions","organizations_url":"https://api.github.com/users/leonmak/orgs","repos_url":"https://api.github.com/users/leonmak/repos","events_url":"https://api.github.com/users/leonmak/events{/privacy}","received_events_url":"https://api.github.com/users/leonmak/received_events","type":"User","site_admin":false},"repo":{"id":61047323,"name":"loklak_walls","full_name":"leonmak/loklak_walls","owner":{"login":"leonmak","id":13071508,"avatar_url":"https://avatars.githubusercontent.com/u/13071508?v=3","gravatar_id":"","url":"https://api.github.com/users/leonmak","html_url":"https://github.com/leonmak","followers_url":"https://api.github.com/users/leonmak/followers","following_url":"https://api.github.com/users/leonmak/following{/other_user}","gists_url":"https://api.github.com/users/leonmak/gists{/gist_id}","starred_url":"https://api.github.com/users/leonmak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonmak/subscriptions","organizations_url":"https://api.github.com/users/leonmak/orgs","repos_url":"https://api.github.com/users/leonmak/repos","events_url":"https://api.github.com/users/leonmak/events{/privacy}","received_events_url":"https://api.github.com/users/leonmak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leonmak/loklak_walls","description":"loklak walls application","fork":true,"url":"https://api.github.com/repos/leonmak/loklak_walls","forks_url":"https://api.github.com/repos/leonmak/loklak_walls/forks","keys_url":"https://api.github.com/repos/leonmak/loklak_walls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leonmak/loklak_walls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leonmak/loklak_walls/teams","hooks_url":"https://api.github.com/repos/leonmak/loklak_walls/hooks","issue_events_url":"https://api.github.com/repos/leonmak/loklak_walls/issues/events{/number}","events_url":"https://api.github.com/repos/leonmak/loklak_walls/events","assignees_url":"https://api.github.com/repos/leonmak/loklak_walls/assignees{/user}","branches_url":"https://api.github.com/repos/leonmak/loklak_walls/branches{/branch}","tags_url":"https://api.github.com/repos/leonmak/loklak_walls/tags","blobs_url":"https://api.github.com/repos/leonmak/loklak_walls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leonmak/loklak_walls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leonmak/loklak_walls/git/refs{/sha}","trees_url":"https://api.github.com/repos/leonmak/loklak_walls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leonmak/loklak_walls/statuses/{sha}","languages_url":"https://api.github.com/repos/leonmak/loklak_walls/languages","stargazers_url":"https://api.github.com/repos/leonmak/loklak_walls/stargazers","contributors_url":"https://api.github.com/repos/leonmak/loklak_walls/contributors","subscribers_url":"https://api.github.com/repos/leonmak/loklak_walls/subscribers","subscription_url":"https://api.github.com/repos/leonmak/loklak_walls/subscription","commits_url":"https://api.github.com/repos/leonmak/loklak_walls/commits{/sha}","git_commits_url":"https://api.github.com/repos/leonmak/loklak_walls/git/commits{/sha}","comments_url":"https://api.github.com/repos/leonmak/loklak_walls/comments{/number}","issue_comment_url":"https://api.github.com/repos/leonmak/loklak_walls/issues/comments{/number}","contents_url":"https://api.github.com/repos/leonmak/loklak_walls/contents/{+path}","compare_url":"https://api.github.com/repos/leonmak/loklak_walls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leonmak/loklak_walls/merges","archive_url":"https://api.github.com/repos/leonmak/loklak_walls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leonmak/loklak_walls/downloads","issues_url":"https://api.github.com/repos/leonmak/loklak_walls/issues{/number}","pulls_url":"https://api.github.com/repos/leonmak/loklak_walls/pulls{/number}","milestones_url":"https://api.github.com/repos/leonmak/loklak_walls/milestones{/number}","notifications_url":"https://api.github.com/repos/leonmak/loklak_walls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leonmak/loklak_walls/labels{/name}","releases_url":"https://api.github.com/repos/leonmak/loklak_walls/releases{/id}","deployments_url":"https://api.github.com/repos/leonmak/loklak_walls/deployments","created_at":"2016-06-13T15:24:33Z","updated_at":"2016-06-13T15:24:35Z","pushed_at":"2016-06-14T19:02:35Z","git_url":"git://github.com/leonmak/loklak_walls.git","ssh_url":"git@github.com:leonmak/loklak_walls.git","clone_url":"https://github.com/leonmak/loklak_walls.git","svn_url":"https://github.com/leonmak/loklak_walls","homepage":"","size":4312,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"loklak:master","ref":"master","sha":"5a0747ba9f6a044a05e2394d5f9ff07f5f5ff79c","user":{"login":"loklak","id":11370631,"avatar_url":"https://avatars.githubusercontent.com/u/11370631?v=3","gravatar_id":"","url":"https://api.github.com/users/loklak","html_url":"https://github.com/loklak","followers_url":"https://api.github.com/users/loklak/followers","following_url":"https://api.github.com/users/loklak/following{/other_user}","gists_url":"https://api.github.com/users/loklak/gists{/gist_id}","starred_url":"https://api.github.com/users/loklak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loklak/subscriptions","organizations_url":"https://api.github.com/users/loklak/orgs","repos_url":"https://api.github.com/users/loklak/repos","events_url":"https://api.github.com/users/loklak/events{/privacy}","received_events_url":"https://api.github.com/users/loklak/received_events","type":"Organization","site_admin":false},"repo":{"id":61033249,"name":"loklak_walls","full_name":"loklak/loklak_walls","owner":{"login":"loklak","id":11370631,"avatar_url":"https://avatars.githubusercontent.com/u/11370631?v=3","gravatar_id":"","url":"https://api.github.com/users/loklak","html_url":"https://github.com/loklak","followers_url":"https://api.github.com/users/loklak/followers","following_url":"https://api.github.com/users/loklak/following{/other_user}","gists_url":"https://api.github.com/users/loklak/gists{/gist_id}","starred_url":"https://api.github.com/users/loklak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loklak/subscriptions","organizations_url":"https://api.github.com/users/loklak/orgs","repos_url":"https://api.github.com/users/loklak/repos","events_url":"https://api.github.com/users/loklak/events{/privacy}","received_events_url":"https://api.github.com/users/loklak/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/loklak/loklak_walls","description":"loklak walls application","fork":false,"url":"https://api.github.com/repos/loklak/loklak_walls","forks_url":"https://api.github.com/repos/loklak/loklak_walls/forks","keys_url":"https://api.github.com/repos/loklak/loklak_walls/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loklak/loklak_walls/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loklak/loklak_walls/teams","hooks_url":"https://api.github.com/repos/loklak/loklak_walls/hooks","issue_events_url":"https://api.github.com/repos/loklak/loklak_walls/issues/events{/number}","events_url":"https://api.github.com/repos/loklak/loklak_walls/events","assignees_url":"https://api.github.com/repos/loklak/loklak_walls/assignees{/user}","branches_url":"https://api.github.com/repos/loklak/loklak_walls/branches{/branch}","tags_url":"https://api.github.com/repos/loklak/loklak_walls/tags","blobs_url":"https://api.github.com/repos/loklak/loklak_walls/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loklak/loklak_walls/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loklak/loklak_walls/git/refs{/sha}","trees_url":"https://api.github.com/repos/loklak/loklak_walls/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loklak/loklak_walls/statuses/{sha}","languages_url":"https://api.github.com/repos/loklak/loklak_walls/languages","stargazers_url":"https://api.github.com/repos/loklak/loklak_walls/stargazers","contributors_url":"https://api.github.com/repos/loklak/loklak_walls/contributors","subscribers_url":"https://api.github.com/repos/loklak/loklak_walls/subscribers","subscription_url":"https://api.github.com/repos/loklak/loklak_walls/subscription","commits_url":"https://api.github.com/repos/loklak/loklak_walls/commits{/sha}","git_commits_url":"https://api.github.com/repos/loklak/loklak_walls/git/commits{/sha}","comments_url":"https://api.github.com/repos/loklak/loklak_walls/comments{/number}","issue_comment_url":"https://api.github.com/repos/loklak/loklak_walls/issues/comments{/number}","contents_url":"https://api.github.com/repos/loklak/loklak_walls/contents/{+path}","compare_url":"https://api.github.com/repos/loklak/loklak_walls/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loklak/loklak_walls/merges","archive_url":"https://api.github.com/repos/loklak/loklak_walls/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loklak/loklak_walls/downloads","issues_url":"https://api.github.com/repos/loklak/loklak_walls/issues{/number}","pulls_url":"https://api.github.com/repos/loklak/loklak_walls/pulls{/number}","milestones_url":"https://api.github.com/repos/loklak/loklak_walls/milestones{/number}","notifications_url":"https://api.github.com/repos/loklak/loklak_walls/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loklak/loklak_walls/labels{/name}","releases_url":"https://api.github.com/repos/loklak/loklak_walls/releases{/id}","deployments_url":"https://api.github.com/repos/loklak/loklak_walls/deployments","created_at":"2016-06-13T12:08:08Z","updated_at":"2016-06-13T12:41:02Z","pushed_at":"2016-06-14T19:03:29Z","git_url":"git://github.com/loklak/loklak_walls.git","ssh_url":"git@github.com:loklak/loklak_walls.git","clone_url":"https://github.com/loklak/loklak_walls.git","svn_url":"https://github.com/loklak/loklak_walls","homepage":"","size":4326,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/loklak/loklak_walls/pulls/5"},"html":{"href":"https://github.com/loklak/loklak_walls/pull/5"},"issue":{"href":"https://api.github.com/repos/loklak/loklak_walls/issues/5"},"comments":{"href":"https://api.github.com/repos/loklak/loklak_walls/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/loklak/loklak_walls/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/loklak/loklak_walls/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/loklak/loklak_walls/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/loklak/loklak_walls/statuses/06a36dcda2f6e68e50410d953785f4a8ca9ddae2"}}}}
{"actor":{"display_login":"houndci-bot"}}