{"action":"opened","number":310,"pull_request":{"url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/310","id":58892607,"html_url":"https://github.com/stormpath/express-stormpath/pull/310","diff_url":"https://github.com/stormpath/express-stormpath/pull/310.diff","patch_url":"https://github.com/stormpath/express-stormpath/pull/310.patch","issue_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/310","number":310,"state":"open","locked":false,"title":"JSON view model for GET on /login","user":{"login":"timothyej","id":721091,"avatar_url":"https://avatars.githubusercontent.com/u/721091?v=3","gravatar_id":"","url":"https://api.github.com/users/timothyej","html_url":"https://github.com/timothyej","followers_url":"https://api.github.com/users/timothyej/followers","following_url":"https://api.github.com/users/timothyej/following{/other_user}","gists_url":"https://api.github.com/users/timothyej/gists{/gist_id}","starred_url":"https://api.github.com/users/timothyej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothyej/subscriptions","organizations_url":"https://api.github.com/users/timothyej/orgs","repos_url":"https://api.github.com/users/timothyej/repos","events_url":"https://api.github.com/users/timothyej/events{/privacy}","received_events_url":"https://api.github.com/users/timothyej/received_events","type":"User","site_admin":false},"body":"Fixes #306.\r\n\r\nThis PR implement a JSON view model for `GET` on `/login` according to the [spec](https://github.com/stormpath/stormpath-framework-spec/blob/master/login.md#login-view-model).\r\n\r\n### Notes\r\n\r\n* This PR is going to be merged into `framework-spec-upgrade`.\r\n\r\n* I'm not sure if the account stores should only include SAML and social providers, or just all of them. If so, how do I filter them out?\r\n\r\n### Todo\r\n\r\n* Break out `getProviders()` into smaller functions?\r\n* Write tests\r\n\r\n### How to verify\r\n\r\n1. Checkout this branch\r\n2. Clone [express-stormpath-sample-project](https://github.com/stormpath/express-stormpath-sample-project)\r\n3. Use `npm link` and `npm link express-stormpath` to link the library to the example project\r\n4. Make a `GET` request to `/login` with the `Accept` header set to `application/json`\r\n5. Verify that you get a JSON model back according to the [spec](https://github.com/stormpath/stormpath-framework-spec/blob/master/login.md#login-view-model)\r\n6. Try to edit the config (`web.login.fields` and `web.login.fieldOrder`) and verify that the fields and its order are correct\r\n7. Verify the content of `accountStores` and see my notes about it\r\n","created_at":"2016-02-10T13:51:15Z","updated_at":"2016-02-10T13:51:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":{"url":"https://api.github.com/repos/stormpath/express-stormpath/milestones/11","html_url":"https://github.com/stormpath/express-stormpath/milestones/2.5","labels_url":"https://api.github.com/repos/stormpath/express-stormpath/milestones/11/labels","id":1562710,"number":11,"title":"2.5","description":"Upgrades to comply with framework spec","creator":{"login":"robertjd","id":132343,"avatar_url":"https://avatars.githubusercontent.com/u/132343?v=3","gravatar_id":"","url":"https://api.github.com/users/robertjd","html_url":"https://github.com/robertjd","followers_url":"https://api.github.com/users/robertjd/followers","following_url":"https://api.github.com/users/robertjd/following{/other_user}","gists_url":"https://api.github.com/users/robertjd/gists{/gist_id}","starred_url":"https://api.github.com/users/robertjd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertjd/subscriptions","organizations_url":"https://api.github.com/users/robertjd/orgs","repos_url":"https://api.github.com/users/robertjd/repos","events_url":"https://api.github.com/users/robertjd/events{/privacy}","received_events_url":"https://api.github.com/users/robertjd/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2016-02-04T08:33:04Z","updated_at":"2016-02-10T13:51:15Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/310/commits","review_comments_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/310/comments","review_comment_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/310/comments","statuses_url":"https://api.github.com/repos/stormpath/express-stormpath/statuses/13bf139d55f39937e7c07670dc809fb1b1eef729","head":{"label":"stormpath:framework-spec-json-view-models","ref":"framework-spec-json-view-models","sha":"13bf139d55f39937e7c07670dc809fb1b1eef729","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":21433270,"name":"express-stormpath","full_name":"stormpath/express-stormpath","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/express-stormpath","description":"Build simple, secure web applications with Stormpath and Express!","fork":false,"url":"https://api.github.com/repos/stormpath/express-stormpath","forks_url":"https://api.github.com/repos/stormpath/express-stormpath/forks","keys_url":"https://api.github.com/repos/stormpath/express-stormpath/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/express-stormpath/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/express-stormpath/teams","hooks_url":"https://api.github.com/repos/stormpath/express-stormpath/hooks","issue_events_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/express-stormpath/events","assignees_url":"https://api.github.com/repos/stormpath/express-stormpath/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/express-stormpath/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/express-stormpath/tags","blobs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/express-stormpath/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/express-stormpath/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/express-stormpath/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/express-stormpath/languages","stargazers_url":"https://api.github.com/repos/stormpath/express-stormpath/stargazers","contributors_url":"https://api.github.com/repos/stormpath/express-stormpath/contributors","subscribers_url":"https://api.github.com/repos/stormpath/express-stormpath/subscribers","subscription_url":"https://api.github.com/repos/stormpath/express-stormpath/subscription","commits_url":"https://api.github.com/repos/stormpath/express-stormpath/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/express-stormpath/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/express-stormpath/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/express-stormpath/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/express-stormpath/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/express-stormpath/merges","archive_url":"https://api.github.com/repos/stormpath/express-stormpath/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/express-stormpath/downloads","issues_url":"https://api.github.com/repos/stormpath/express-stormpath/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/express-stormpath/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/express-stormpath/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/express-stormpath/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/express-stormpath/releases{/id}","deployments_url":"https://api.github.com/repos/stormpath/express-stormpath/deployments","created_at":"2014-07-02T17:25:41Z","updated_at":"2016-02-04T17:26:56Z","pushed_at":"2016-02-10T13:47:59Z","git_url":"git://github.com/stormpath/express-stormpath.git","ssh_url":"git@github.com:stormpath/express-stormpath.git","clone_url":"https://github.com/stormpath/express-stormpath.git","svn_url":"https://github.com/stormpath/express-stormpath","homepage":"http://docs.stormpath.com/nodejs/express/","size":14079,"stargazers_count":150,"watchers_count":150,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":38,"forks":62,"open_issues":38,"watchers":150,"default_branch":"master"}},"base":{"label":"stormpath:framework-spec-upgrade","ref":"framework-spec-upgrade","sha":"fd2e0b741636e7e09bd960e828f77bec7d23b116","user":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"repo":{"id":21433270,"name":"express-stormpath","full_name":"stormpath/express-stormpath","owner":{"login":"stormpath","id":1377453,"avatar_url":"https://avatars.githubusercontent.com/u/1377453?v=3","gravatar_id":"","url":"https://api.github.com/users/stormpath","html_url":"https://github.com/stormpath","followers_url":"https://api.github.com/users/stormpath/followers","following_url":"https://api.github.com/users/stormpath/following{/other_user}","gists_url":"https://api.github.com/users/stormpath/gists{/gist_id}","starred_url":"https://api.github.com/users/stormpath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stormpath/subscriptions","organizations_url":"https://api.github.com/users/stormpath/orgs","repos_url":"https://api.github.com/users/stormpath/repos","events_url":"https://api.github.com/users/stormpath/events{/privacy}","received_events_url":"https://api.github.com/users/stormpath/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stormpath/express-stormpath","description":"Build simple, secure web applications with Stormpath and Express!","fork":false,"url":"https://api.github.com/repos/stormpath/express-stormpath","forks_url":"https://api.github.com/repos/stormpath/express-stormpath/forks","keys_url":"https://api.github.com/repos/stormpath/express-stormpath/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stormpath/express-stormpath/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stormpath/express-stormpath/teams","hooks_url":"https://api.github.com/repos/stormpath/express-stormpath/hooks","issue_events_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/events{/number}","events_url":"https://api.github.com/repos/stormpath/express-stormpath/events","assignees_url":"https://api.github.com/repos/stormpath/express-stormpath/assignees{/user}","branches_url":"https://api.github.com/repos/stormpath/express-stormpath/branches{/branch}","tags_url":"https://api.github.com/repos/stormpath/express-stormpath/tags","blobs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stormpath/express-stormpath/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stormpath/express-stormpath/git/refs{/sha}","trees_url":"https://api.github.com/repos/stormpath/express-stormpath/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stormpath/express-stormpath/statuses/{sha}","languages_url":"https://api.github.com/repos/stormpath/express-stormpath/languages","stargazers_url":"https://api.github.com/repos/stormpath/express-stormpath/stargazers","contributors_url":"https://api.github.com/repos/stormpath/express-stormpath/contributors","subscribers_url":"https://api.github.com/repos/stormpath/express-stormpath/subscribers","subscription_url":"https://api.github.com/repos/stormpath/express-stormpath/subscription","commits_url":"https://api.github.com/repos/stormpath/express-stormpath/commits{/sha}","git_commits_url":"https://api.github.com/repos/stormpath/express-stormpath/git/commits{/sha}","comments_url":"https://api.github.com/repos/stormpath/express-stormpath/comments{/number}","issue_comment_url":"https://api.github.com/repos/stormpath/express-stormpath/issues/comments{/number}","contents_url":"https://api.github.com/repos/stormpath/express-stormpath/contents/{+path}","compare_url":"https://api.github.com/repos/stormpath/express-stormpath/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stormpath/express-stormpath/merges","archive_url":"https://api.github.com/repos/stormpath/express-stormpath/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stormpath/express-stormpath/downloads","issues_url":"https://api.github.com/repos/stormpath/express-stormpath/issues{/number}","pulls_url":"https://api.github.com/repos/stormpath/express-stormpath/pulls{/number}","milestones_url":"https://api.github.com/repos/stormpath/express-stormpath/milestones{/number}","notifications_url":"https://api.github.com/repos/stormpath/express-stormpath/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stormpath/express-stormpath/labels{/name}","releases_url":"https://api.github.com/repos/stormpath/express-stormpath/releases{/id}","deployments_url":"https://api.github.com/repos/stormpath/express-stormpath/deployments","created_at":"2014-07-02T17:25:41Z","updated_at":"2016-02-04T17:26:56Z","pushed_at":"2016-02-10T13:47:59Z","git_url":"git://github.com/stormpath/express-stormpath.git","ssh_url":"git@github.com:stormpath/express-stormpath.git","clone_url":"https://github.com/stormpath/express-stormpath.git","svn_url":"https://github.com/stormpath/express-stormpath","homepage":"http://docs.stormpath.com/nodejs/express/","size":14079,"stargazers_count":150,"watchers_count":150,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":38,"forks":62,"open_issues":38,"watchers":150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/310"},"html":{"href":"https://github.com/stormpath/express-stormpath/pull/310"},"issue":{"href":"https://api.github.com/repos/stormpath/express-stormpath/issues/310"},"comments":{"href":"https://api.github.com/repos/stormpath/express-stormpath/issues/310/comments"},"review_comments":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/310/comments"},"review_comment":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stormpath/express-stormpath/pulls/310/commits"},"statuses":{"href":"https://api.github.com/repos/stormpath/express-stormpath/statuses/13bf139d55f39937e7c07670dc809fb1b1eef729"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":158,"deletions":0,"changed_files":3}}