{"action":"created","comment":{"url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/comments/65817165","id":65817165,"diff_hunk":"@@ -0,0 +1,78 @@\n+<?php\n+\n+/**\n+ * Implements hook_form_alter().\n+ */\n+function pubkey_encrypt_form_alter(&$form, $form_state, $form_id) {\n+  switch ($form_id) {\n+    case 'user_login_form':\n+      // Try to have this form pass through our custom handler first.\n+      array_unshift($form['#submit'], 'custom_login_submit');\n+      break;\n+\n+    case 'user_form':\n+      // Have this form pass through our custom handler too.\n+      $form['actions']['submit']['#submit'][] = 'custom_user_form_submit';\n+  }\n+}\n+\n+/**\n+ * Custom submit handler for login form.\n+ */\n+function custom_login_submit($form, \\Drupal\\Core\\Form\\FormStateInterface &$form_state) {\n+  // Fetch inputted username and password.\n+  $username = $form_state->getValue('name');\n+  $password = $form_state->getValue('pass');\n+\n+  // Temporarily store the plaintext password to be used for hook_user_login().\n+  // We cannot put this in private_tempstore as no user has been logged in yet.\n+  $tempstore = \\Drupal::service('user.shared_tempstore')->get('pubkey_encrypt');\n+  $tempstore->set($username, $password);\n+}\n+\n+/**\n+ * Implements hook_user_login().\n+ */\n+function pubkey_encrypt_user_login(\\Drupal\\user\\UserInterface $account) {\n+  // A user just logged in.\n+  $username = $account->get('name')->get(0);\n+  $username = $username->getValue();\n+  $username = $username['value'];","path":"pubkey_encrypt.module","position":40,"original_position":40,"commit_id":"96c817806ee2c3f7d30009f38f534d7b8bfe0fd7","original_commit_id":"96c817806ee2c3f7d30009f38f534d7b8bfe0fd7","user":{"login":"talhaparacha","id":15692050,"avatar_url":"https://avatars.githubusercontent.com/u/15692050?v=3","gravatar_id":"","url":"https://api.github.com/users/talhaparacha","html_url":"https://github.com/talhaparacha","followers_url":"https://api.github.com/users/talhaparacha/followers","following_url":"https://api.github.com/users/talhaparacha/following{/other_user}","gists_url":"https://api.github.com/users/talhaparacha/gists{/gist_id}","starred_url":"https://api.github.com/users/talhaparacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talhaparacha/subscriptions","organizations_url":"https://api.github.com/users/talhaparacha/orgs","repos_url":"https://api.github.com/users/talhaparacha/repos","events_url":"https://api.github.com/users/talhaparacha/events{/privacy}","received_events_url":"https://api.github.com/users/talhaparacha/received_events","type":"User","site_admin":false},"body":"Done. For reference:\r\n\r\n` $username = $account->get('name')->getString();`","created_at":"2016-06-05T13:09:23Z","updated_at":"2016-06-05T13:09:23Z","html_url":"https://github.com/d8-contrib-modules/pubkey_encrypt/pull/2#discussion_r65817165","pull_request_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/comments/65817165"},"html":{"href":"https://github.com/d8-contrib-modules/pubkey_encrypt/pull/2#discussion_r65817165"},"pull_request":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2","id":71088104,"html_url":"https://github.com/d8-contrib-modules/pubkey_encrypt/pull/2","diff_url":"https://github.com/d8-contrib-modules/pubkey_encrypt/pull/2.diff","patch_url":"https://github.com/d8-contrib-modules/pubkey_encrypt/pull/2.patch","issue_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues/2","number":2,"state":"open","locked":false,"title":"Added support for handling Public/Private keys","user":{"login":"talhaparacha","id":15692050,"avatar_url":"https://avatars.githubusercontent.com/u/15692050?v=3","gravatar_id":"","url":"https://api.github.com/users/talhaparacha","html_url":"https://github.com/talhaparacha","followers_url":"https://api.github.com/users/talhaparacha/followers","following_url":"https://api.github.com/users/talhaparacha/following{/other_user}","gists_url":"https://api.github.com/users/talhaparacha/gists{/gist_id}","starred_url":"https://api.github.com/users/talhaparacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talhaparacha/subscriptions","organizations_url":"https://api.github.com/users/talhaparacha/orgs","repos_url":"https://api.github.com/users/talhaparacha/repos","events_url":"https://api.github.com/users/talhaparacha/events{/privacy}","received_events_url":"https://api.github.com/users/talhaparacha/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-23T17:31:50Z","updated_at":"2016-06-05T13:09:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddb3df6bdd18db6e5eef5bedc0ceb3eba0e9ed32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2/commits","review_comments_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2/comments","review_comment_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues/2/comments","statuses_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/statuses/96c817806ee2c3f7d30009f38f534d7b8bfe0fd7","head":{"label":"talhaparacha:8.x","ref":"8.x","sha":"96c817806ee2c3f7d30009f38f534d7b8bfe0fd7","user":{"login":"talhaparacha","id":15692050,"avatar_url":"https://avatars.githubusercontent.com/u/15692050?v=3","gravatar_id":"","url":"https://api.github.com/users/talhaparacha","html_url":"https://github.com/talhaparacha","followers_url":"https://api.github.com/users/talhaparacha/followers","following_url":"https://api.github.com/users/talhaparacha/following{/other_user}","gists_url":"https://api.github.com/users/talhaparacha/gists{/gist_id}","starred_url":"https://api.github.com/users/talhaparacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talhaparacha/subscriptions","organizations_url":"https://api.github.com/users/talhaparacha/orgs","repos_url":"https://api.github.com/users/talhaparacha/repos","events_url":"https://api.github.com/users/talhaparacha/events{/privacy}","received_events_url":"https://api.github.com/users/talhaparacha/received_events","type":"User","site_admin":false},"repo":{"id":59433662,"name":"pubkey_encrypt","full_name":"talhaparacha/pubkey_encrypt","owner":{"login":"talhaparacha","id":15692050,"avatar_url":"https://avatars.githubusercontent.com/u/15692050?v=3","gravatar_id":"","url":"https://api.github.com/users/talhaparacha","html_url":"https://github.com/talhaparacha","followers_url":"https://api.github.com/users/talhaparacha/followers","following_url":"https://api.github.com/users/talhaparacha/following{/other_user}","gists_url":"https://api.github.com/users/talhaparacha/gists{/gist_id}","starred_url":"https://api.github.com/users/talhaparacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talhaparacha/subscriptions","organizations_url":"https://api.github.com/users/talhaparacha/orgs","repos_url":"https://api.github.com/users/talhaparacha/repos","events_url":"https://api.github.com/users/talhaparacha/events{/privacy}","received_events_url":"https://api.github.com/users/talhaparacha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/talhaparacha/pubkey_encrypt","description":"Public Key Based Encryption","fork":true,"url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt","forks_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/forks","keys_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/teams","hooks_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/hooks","issue_events_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/issues/events{/number}","events_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/events","assignees_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/assignees{/user}","branches_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/branches{/branch}","tags_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/tags","blobs_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/git/refs{/sha}","trees_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/statuses/{sha}","languages_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/languages","stargazers_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/stargazers","contributors_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/contributors","subscribers_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/subscribers","subscription_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/subscription","commits_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/commits{/sha}","git_commits_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/git/commits{/sha}","comments_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/comments{/number}","issue_comment_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/issues/comments{/number}","contents_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/contents/{+path}","compare_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/merges","archive_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/downloads","issues_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/issues{/number}","pulls_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/pulls{/number}","milestones_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/milestones{/number}","notifications_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/labels{/name}","releases_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/releases{/id}","deployments_url":"https://api.github.com/repos/talhaparacha/pubkey_encrypt/deployments","created_at":"2016-05-22T20:47:54Z","updated_at":"2016-05-26T17:18:05Z","pushed_at":"2016-05-27T21:54:24Z","git_url":"git://github.com/talhaparacha/pubkey_encrypt.git","ssh_url":"git@github.com:talhaparacha/pubkey_encrypt.git","clone_url":"https://github.com/talhaparacha/pubkey_encrypt.git","svn_url":"https://github.com/talhaparacha/pubkey_encrypt","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"8.x"}},"base":{"label":"d8-contrib-modules:8.x","ref":"8.x","sha":"d223d86e4a7584838bc577928800c2510baf1a1b","user":{"login":"d8-contrib-modules","id":13561676,"avatar_url":"https://avatars.githubusercontent.com/u/13561676?v=3","gravatar_id":"","url":"https://api.github.com/users/d8-contrib-modules","html_url":"https://github.com/d8-contrib-modules","followers_url":"https://api.github.com/users/d8-contrib-modules/followers","following_url":"https://api.github.com/users/d8-contrib-modules/following{/other_user}","gists_url":"https://api.github.com/users/d8-contrib-modules/gists{/gist_id}","starred_url":"https://api.github.com/users/d8-contrib-modules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d8-contrib-modules/subscriptions","organizations_url":"https://api.github.com/users/d8-contrib-modules/orgs","repos_url":"https://api.github.com/users/d8-contrib-modules/repos","events_url":"https://api.github.com/users/d8-contrib-modules/events{/privacy}","received_events_url":"https://api.github.com/users/d8-contrib-modules/received_events","type":"Organization","site_admin":false},"repo":{"id":58058830,"name":"pubkey_encrypt","full_name":"d8-contrib-modules/pubkey_encrypt","owner":{"login":"d8-contrib-modules","id":13561676,"avatar_url":"https://avatars.githubusercontent.com/u/13561676?v=3","gravatar_id":"","url":"https://api.github.com/users/d8-contrib-modules","html_url":"https://github.com/d8-contrib-modules","followers_url":"https://api.github.com/users/d8-contrib-modules/followers","following_url":"https://api.github.com/users/d8-contrib-modules/following{/other_user}","gists_url":"https://api.github.com/users/d8-contrib-modules/gists{/gist_id}","starred_url":"https://api.github.com/users/d8-contrib-modules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d8-contrib-modules/subscriptions","organizations_url":"https://api.github.com/users/d8-contrib-modules/orgs","repos_url":"https://api.github.com/users/d8-contrib-modules/repos","events_url":"https://api.github.com/users/d8-contrib-modules/events{/privacy}","received_events_url":"https://api.github.com/users/d8-contrib-modules/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/d8-contrib-modules/pubkey_encrypt","description":"Public Key Based Encryption","fork":false,"url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt","forks_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/forks","keys_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/teams","hooks_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/hooks","issue_events_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues/events{/number}","events_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/events","assignees_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/assignees{/user}","branches_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/branches{/branch}","tags_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/tags","blobs_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/git/refs{/sha}","trees_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/statuses/{sha}","languages_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/languages","stargazers_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/stargazers","contributors_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/contributors","subscribers_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/subscribers","subscription_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/subscription","commits_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/commits{/sha}","git_commits_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/git/commits{/sha}","comments_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/comments{/number}","issue_comment_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues/comments{/number}","contents_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/contents/{+path}","compare_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/merges","archive_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/downloads","issues_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues{/number}","pulls_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls{/number}","milestones_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/milestones{/number}","notifications_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/labels{/name}","releases_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/releases{/id}","deployments_url":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/deployments","created_at":"2016-05-04T14:31:24Z","updated_at":"2016-05-04T14:31:24Z","pushed_at":"2016-05-27T21:54:25Z","git_url":"git://github.com/d8-contrib-modules/pubkey_encrypt.git","ssh_url":"git@github.com:d8-contrib-modules/pubkey_encrypt.git","clone_url":"https://github.com/d8-contrib-modules/pubkey_encrypt.git","svn_url":"https://github.com/d8-contrib-modules/pubkey_encrypt","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"8.x"}},"_links":{"self":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2"},"html":{"href":"https://github.com/d8-contrib-modules/pubkey_encrypt/pull/2"},"issue":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues/2"},"comments":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/d8-contrib-modules/pubkey_encrypt/statuses/96c817806ee2c3f7d30009f38f534d7b8bfe0fd7"}}}}
{"actor":{"display_login":"talhaparacha"}}