{"action":"created","comment":{"url":"https://api.github.com/repos/fossasia/badgeyay/pulls/comments/187793388","pull_request_review_id":119647381,"id":187793388,"diff_hunk":"@@ -0,0 +1,33 @@\n+import jwt\n+import datetime\n+\n+from flask import Blueprint, jsonify, request\n+from flask import current_app as app\n+from utils.response import Response\n+from models.user import User, ResetPassword\n+\n+router = Blueprint('resetUser', __name__)\n+\n+@router.route('/password', methods=['POST'])\n+def reset_password():\n+    try:\n+        data = request.get_json()\n+    except Exception as e:\n+        return jsonify(\n+            Response(500).generateMessage(\n+                str(e)))\n+\n+    if data and data['username']:\n+        user = User.getUser(data['username'])\n+        expire = datetime.datetime.utcnow() + datetime.timedelta(seconds=600)\n+        token = jwt.encode(\n+            {'id': user.username,\n+            'exp': expire},","path":"backend/blueprint/api/controllers/resetUser.py","position":25,"original_position":25,"commit_id":"faffe8dd8452a78059f53f501e5cc3f455526bc8","original_commit_id":"34222e872a9cb660f7a886071c4662efb0fb8849","user":{"login":"gabru-md","id":25414121,"avatar_url":"https://avatars1.githubusercontent.com/u/25414121?v=4","gravatar_id":"","url":"https://api.github.com/users/gabru-md","html_url":"https://github.com/gabru-md","followers_url":"https://api.github.com/users/gabru-md/followers","following_url":"https://api.github.com/users/gabru-md/following{/other_user}","gists_url":"https://api.github.com/users/gabru-md/gists{/gist_id}","starred_url":"https://api.github.com/users/gabru-md/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabru-md/subscriptions","organizations_url":"https://api.github.com/users/gabru-md/orgs","repos_url":"https://api.github.com/users/gabru-md/repos","events_url":"https://api.github.com/users/gabru-md/events{/privacy}","received_events_url":"https://api.github.com/users/gabru-md/received_events","type":"User","site_admin":false},"body":"```python\r\njwt.encode({\r\n'id' : ...,\r\n'exp' : ...\r\n},\r\napp.config['SECRET_KEY'])\r\n```\r\n\r\nbring the closing curly brace next in next line","created_at":"2018-05-13T08:55:32Z","updated_at":"2018-05-13T08:57:02Z","html_url":"https://github.com/fossasia/badgeyay/pull/721#discussion_r187793388","pull_request_url":"https://api.github.com/repos/fossasia/badgeyay/pulls/721","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/fossasia/badgeyay/pulls/comments/187793388"},"html":{"href":"https://github.com/fossasia/badgeyay/pull/721#discussion_r187793388"},"pull_request":{"href":"https://api.github.com/repos/fossasia/badgeyay/pulls/721"}},"in_reply_to_id":187275806},"pull_request":{"url":"https://api.github.com/repos/fossasia/badgeyay/pulls/721","id":187136658,"html_url":"https://github.com/fossasia/badgeyay/pull/721","diff_url":"https://github.com/fossasia/badgeyay/pull/721.diff","patch_url":"https://github.com/fossasia/badgeyay/pull/721.patch","issue_url":"https://api.github.com/repos/fossasia/badgeyay/issues/721","number":721,"state":"open","locked":false,"title":"Fixes #719: Generated link for Forgot Password Endpoint","user":{"login":"yashLadha","id":18033231,"avatar_url":"https://avatars3.githubusercontent.com/u/18033231?v=4","gravatar_id":"","url":"https://api.github.com/users/yashLadha","html_url":"https://github.com/yashLadha","followers_url":"https://api.github.com/users/yashLadha/followers","following_url":"https://api.github.com/users/yashLadha/following{/other_user}","gists_url":"https://api.github.com/users/yashLadha/gists{/gist_id}","starred_url":"https://api.github.com/users/yashLadha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yashLadha/subscriptions","organizations_url":"https://api.github.com/users/yashLadha/orgs","repos_url":"https://api.github.com/users/yashLadha/repos","events_url":"https://api.github.com/users/yashLadha/events{/privacy}","received_events_url":"https://api.github.com/users/yashLadha/received_events","type":"User","site_admin":false},"body":"<!-- Add the issue number that is fixed by this PR (In the form Fixes #123) -->\r\nFixes #719 \r\n\r\n#### Checklist\r\n\r\n- [x] I have read the [Contribution & Best practices Guide](https://blog.fossasia.org/open-source-developer-guide-and-best-practices-at-fossasia) and my PR follows them.\r\n- [x] My branch is up-to-date with the Upstream `development` branch.\r\n- [ ] I have added necessary documentation (if appropriate)\r\n\r\n### Preview Link \r\n\r\n- **Replace XXX with your PR no**\r\n- Link to live demo: http://pr-XXX-fossasia-badgeyay.surge.sh  \r\n\r\n#### Changes proposed in this pull request:\r\n\r\n- Created Endpoint with the token\r\n- Necessary frontend redirection still to be made. Will be completed in #629 \r\n","created_at":"2018-05-10T08:55:59Z","updated_at":"2018-05-13T08:57:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2dc384c5917175c3e27ba8aba0f1c2907bf4074","assignee":{"login":"yashLadha","id":18033231,"avatar_url":"https://avatars3.githubusercontent.com/u/18033231?v=4","gravatar_id":"","url":"https://api.github.com/users/yashLadha","html_url":"https://github.com/yashLadha","followers_url":"https://api.github.com/users/yashLadha/followers","following_url":"https://api.github.com/users/yashLadha/following{/other_user}","gists_url":"https://api.github.com/users/yashLadha/gists{/gist_id}","starred_url":"https://api.github.com/users/yashLadha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yashLadha/subscriptions","organizations_url":"https://api.github.com/users/yashLadha/orgs","repos_url":"https://api.github.com/users/yashLadha/repos","events_url":"https://api.github.com/users/yashLadha/events{/privacy}","received_events_url":"https://api.github.com/users/yashLadha/received_events","type":"User","site_admin":false},"assignees":[{"login":"yashLadha","id":18033231,"avatar_url":"https://avatars3.githubusercontent.com/u/18033231?v=4","gravatar_id":"","url":"https://api.github.com/users/yashLadha","html_url":"https://github.com/yashLadha","followers_url":"https://api.github.com/users/yashLadha/followers","following_url":"https://api.github.com/users/yashLadha/following{/other_user}","gists_url":"https://api.github.com/users/yashLadha/gists{/gist_id}","starred_url":"https://api.github.com/users/yashLadha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yashLadha/subscriptions","organizations_url":"https://api.github.com/users/yashLadha/orgs","repos_url":"https://api.github.com/users/yashLadha/repos","events_url":"https://api.github.com/users/yashLadha/events{/privacy}","received_events_url":"https://api.github.com/users/yashLadha/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fossasia/badgeyay/pulls/721/commits","review_comments_url":"https://api.github.com/repos/fossasia/badgeyay/pulls/721/comments","review_comment_url":"https://api.github.com/repos/fossasia/badgeyay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fossasia/badgeyay/issues/721/comments","statuses_url":"https://api.github.com/repos/fossasia/badgeyay/statuses/faffe8dd8452a78059f53f501e5cc3f455526bc8","head":{"label":"yashLadha:reset-password","ref":"reset-password","sha":"faffe8dd8452a78059f53f501e5cc3f455526bc8","user":{"login":"yashLadha","id":18033231,"avatar_url":"https://avatars3.githubusercontent.com/u/18033231?v=4","gravatar_id":"","url":"https://api.github.com/users/yashLadha","html_url":"https://github.com/yashLadha","followers_url":"https://api.github.com/users/yashLadha/followers","following_url":"https://api.github.com/users/yashLadha/following{/other_user}","gists_url":"https://api.github.com/users/yashLadha/gists{/gist_id}","starred_url":"https://api.github.com/users/yashLadha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yashLadha/subscriptions","organizations_url":"https://api.github.com/users/yashLadha/orgs","repos_url":"https://api.github.com/users/yashLadha/repos","events_url":"https://api.github.com/users/yashLadha/events{/privacy}","received_events_url":"https://api.github.com/users/yashLadha/received_events","type":"User","site_admin":false},"repo":{"id":109990095,"name":"badgeyay","full_name":"yashLadha/badgeyay","owner":{"login":"yashLadha","id":18033231,"avatar_url":"https://avatars3.githubusercontent.com/u/18033231?v=4","gravatar_id":"","url":"https://api.github.com/users/yashLadha","html_url":"https://github.com/yashLadha","followers_url":"https://api.github.com/users/yashLadha/followers","following_url":"https://api.github.com/users/yashLadha/following{/other_user}","gists_url":"https://api.github.com/users/yashLadha/gists{/gist_id}","starred_url":"https://api.github.com/users/yashLadha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yashLadha/subscriptions","organizations_url":"https://api.github.com/users/yashLadha/orgs","repos_url":"https://api.github.com/users/yashLadha/repos","events_url":"https://api.github.com/users/yashLadha/events{/privacy}","received_events_url":"https://api.github.com/users/yashLadha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yashLadha/badgeyay","description":"Visitor Badge Generator for Conferences https://badgeyay-dev.herokuapp.com","fork":true,"url":"https://api.github.com/repos/yashLadha/badgeyay","forks_url":"https://api.github.com/repos/yashLadha/badgeyay/forks","keys_url":"https://api.github.com/repos/yashLadha/badgeyay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yashLadha/badgeyay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yashLadha/badgeyay/teams","hooks_url":"https://api.github.com/repos/yashLadha/badgeyay/hooks","issue_events_url":"https://api.github.com/repos/yashLadha/badgeyay/issues/events{/number}","events_url":"https://api.github.com/repos/yashLadha/badgeyay/events","assignees_url":"https://api.github.com/repos/yashLadha/badgeyay/assignees{/user}","branches_url":"https://api.github.com/repos/yashLadha/badgeyay/branches{/branch}","tags_url":"https://api.github.com/repos/yashLadha/badgeyay/tags","blobs_url":"https://api.github.com/repos/yashLadha/badgeyay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yashLadha/badgeyay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yashLadha/badgeyay/git/refs{/sha}","trees_url":"https://api.github.com/repos/yashLadha/badgeyay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yashLadha/badgeyay/statuses/{sha}","languages_url":"https://api.github.com/repos/yashLadha/badgeyay/languages","stargazers_url":"https://api.github.com/repos/yashLadha/badgeyay/stargazers","contributors_url":"https://api.github.com/repos/yashLadha/badgeyay/contributors","subscribers_url":"https://api.github.com/repos/yashLadha/badgeyay/subscribers","subscription_url":"https://api.github.com/repos/yashLadha/badgeyay/subscription","commits_url":"https://api.github.com/repos/yashLadha/badgeyay/commits{/sha}","git_commits_url":"https://api.github.com/repos/yashLadha/badgeyay/git/commits{/sha}","comments_url":"https://api.github.com/repos/yashLadha/badgeyay/comments{/number}","issue_comment_url":"https://api.github.com/repos/yashLadha/badgeyay/issues/comments{/number}","contents_url":"https://api.github.com/repos/yashLadha/badgeyay/contents/{+path}","compare_url":"https://api.github.com/repos/yashLadha/badgeyay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yashLadha/badgeyay/merges","archive_url":"https://api.github.com/repos/yashLadha/badgeyay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yashLadha/badgeyay/downloads","issues_url":"https://api.github.com/repos/yashLadha/badgeyay/issues{/number}","pulls_url":"https://api.github.com/repos/yashLadha/badgeyay/pulls{/number}","milestones_url":"https://api.github.com/repos/yashLadha/badgeyay/milestones{/number}","notifications_url":"https://api.github.com/repos/yashLadha/badgeyay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yashLadha/badgeyay/labels{/name}","releases_url":"https://api.github.com/repos/yashLadha/badgeyay/releases{/id}","deployments_url":"https://api.github.com/repos/yashLadha/badgeyay/deployments","created_at":"2017-11-08T14:58:50Z","updated_at":"2018-05-07T13:50:12Z","pushed_at":"2018-05-13T08:26:37Z","git_url":"git://github.com/yashLadha/badgeyay.git","ssh_url":"git@github.com:yashLadha/badgeyay.git","clone_url":"https://github.com/yashLadha/badgeyay.git","svn_url":"https://github.com/yashLadha/badgeyay","homepage":"","size":34805,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"development"}},"base":{"label":"fossasia:development","ref":"development","sha":"1e578f5516aee824a227a8db9aa5e18670ae2ec4","user":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars3.githubusercontent.com/u/6295529?v=4","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"repo":{"id":93319175,"name":"badgeyay","full_name":"fossasia/badgeyay","owner":{"login":"fossasia","id":6295529,"avatar_url":"https://avatars3.githubusercontent.com/u/6295529?v=4","gravatar_id":"","url":"https://api.github.com/users/fossasia","html_url":"https://github.com/fossasia","followers_url":"https://api.github.com/users/fossasia/followers","following_url":"https://api.github.com/users/fossasia/following{/other_user}","gists_url":"https://api.github.com/users/fossasia/gists{/gist_id}","starred_url":"https://api.github.com/users/fossasia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fossasia/subscriptions","organizations_url":"https://api.github.com/users/fossasia/orgs","repos_url":"https://api.github.com/users/fossasia/repos","events_url":"https://api.github.com/users/fossasia/events{/privacy}","received_events_url":"https://api.github.com/users/fossasia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fossasia/badgeyay","description":"Attendee Badge Generator for Conferences http://badgeyay.com Backend: http://badgeyay-api.herokuapp.com/","fork":false,"url":"https://api.github.com/repos/fossasia/badgeyay","forks_url":"https://api.github.com/repos/fossasia/badgeyay/forks","keys_url":"https://api.github.com/repos/fossasia/badgeyay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fossasia/badgeyay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fossasia/badgeyay/teams","hooks_url":"https://api.github.com/repos/fossasia/badgeyay/hooks","issue_events_url":"https://api.github.com/repos/fossasia/badgeyay/issues/events{/number}","events_url":"https://api.github.com/repos/fossasia/badgeyay/events","assignees_url":"https://api.github.com/repos/fossasia/badgeyay/assignees{/user}","branches_url":"https://api.github.com/repos/fossasia/badgeyay/branches{/branch}","tags_url":"https://api.github.com/repos/fossasia/badgeyay/tags","blobs_url":"https://api.github.com/repos/fossasia/badgeyay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fossasia/badgeyay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fossasia/badgeyay/git/refs{/sha}","trees_url":"https://api.github.com/repos/fossasia/badgeyay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fossasia/badgeyay/statuses/{sha}","languages_url":"https://api.github.com/repos/fossasia/badgeyay/languages","stargazers_url":"https://api.github.com/repos/fossasia/badgeyay/stargazers","contributors_url":"https://api.github.com/repos/fossasia/badgeyay/contributors","subscribers_url":"https://api.github.com/repos/fossasia/badgeyay/subscribers","subscription_url":"https://api.github.com/repos/fossasia/badgeyay/subscription","commits_url":"https://api.github.com/repos/fossasia/badgeyay/commits{/sha}","git_commits_url":"https://api.github.com/repos/fossasia/badgeyay/git/commits{/sha}","comments_url":"https://api.github.com/repos/fossasia/badgeyay/comments{/number}","issue_comment_url":"https://api.github.com/repos/fossasia/badgeyay/issues/comments{/number}","contents_url":"https://api.github.com/repos/fossasia/badgeyay/contents/{+path}","compare_url":"https://api.github.com/repos/fossasia/badgeyay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fossasia/badgeyay/merges","archive_url":"https://api.github.com/repos/fossasia/badgeyay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fossasia/badgeyay/downloads","issues_url":"https://api.github.com/repos/fossasia/badgeyay/issues{/number}","pulls_url":"https://api.github.com/repos/fossasia/badgeyay/pulls{/number}","milestones_url":"https://api.github.com/repos/fossasia/badgeyay/milestones{/number}","notifications_url":"https://api.github.com/repos/fossasia/badgeyay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fossasia/badgeyay/labels{/name}","releases_url":"https://api.github.com/repos/fossasia/badgeyay/releases{/id}","deployments_url":"https://api.github.com/repos/fossasia/badgeyay/deployments","created_at":"2017-06-04T14:32:49Z","updated_at":"2018-05-13T08:49:07Z","pushed_at":"2018-05-13T08:54:12Z","git_url":"git://github.com/fossasia/badgeyay.git","ssh_url":"git@github.com:fossasia/badgeyay.git","clone_url":"https://github.com/fossasia/badgeyay.git","svn_url":"https://github.com/fossasia/badgeyay","homepage":"","size":35982,"stargazers_count":449,"watchers_count":449,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":203,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":203,"open_issues":36,"watchers":449,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/fossasia/badgeyay/pulls/721"},"html":{"href":"https://github.com/fossasia/badgeyay/pull/721"},"issue":{"href":"https://api.github.com/repos/fossasia/badgeyay/issues/721"},"comments":{"href":"https://api.github.com/repos/fossasia/badgeyay/issues/721/comments"},"review_comments":{"href":"https://api.github.com/repos/fossasia/badgeyay/pulls/721/comments"},"review_comment":{"href":"https://api.github.com/repos/fossasia/badgeyay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fossasia/badgeyay/pulls/721/commits"},"statuses":{"href":"https://api.github.com/repos/fossasia/badgeyay/statuses/faffe8dd8452a78059f53f501e5cc3f455526bc8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"gabru-md"}}