{"action":"created","comment":{"url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/comments/218619317","pull_request_review_id":156599509,"id":218619317,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODYxOTMxNw==","diff_hunk":"@@ -0,0 +1,15 @@\n+\n+exports.seed = function(knex, Promise) {\n+  // Deletes ALL existing entries\n+  return knex('credentials').del()\n+    .then(function () {\n+      // Inserts seed entries\n+      return knex('credentials').insert([\n+        {username: 'bobheper1', password: 'biallzabob'},\n+        {username: 'ricardo', password: 'david'},\n+        {username: 'Greg', password: 'mankiw'},\n+        {username: 'orungatan', password: 'spatialmemory'},\n+        {username: 'eric', password: 'elhricson'}","path":"seeds/users_info.js","position":12,"original_position":12,"commit_id":"892369db1fd3611f898bee2b87cf147c6aff5cbd","original_commit_id":"892369db1fd3611f898bee2b87cf147c6aff5cbd","user":{"login":"Tulf","id":6799924,"node_id":"MDQ6VXNlcjY3OTk5MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6799924?v=4","gravatar_id":"","url":"https://api.github.com/users/Tulf","html_url":"https://github.com/Tulf","followers_url":"https://api.github.com/users/Tulf/followers","following_url":"https://api.github.com/users/Tulf/following{/other_user}","gists_url":"https://api.github.com/users/Tulf/gists{/gist_id}","starred_url":"https://api.github.com/users/Tulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tulf/subscriptions","organizations_url":"https://api.github.com/users/Tulf/orgs","repos_url":"https://api.github.com/users/Tulf/repos","events_url":"https://api.github.com/users/Tulf/events{/privacy}","received_events_url":"https://api.github.com/users/Tulf/received_events","type":"User","site_admin":false},"body":"Oh you're right I didn't test these I only tested the ones I passed in. thanks!","created_at":"2018-09-18T22:48:41Z","updated_at":"2018-09-18T22:48:41Z","html_url":"https://github.com/LambdaSchool/auth-i/pull/336#discussion_r218619317","pull_request_url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/comments/218619317"},"html":{"href":"https://github.com/LambdaSchool/auth-i/pull/336#discussion_r218619317"},"pull_request":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336"}},"in_reply_to_id":218561636},"pull_request":{"url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336","id":216138451,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MTM4NDUx","html_url":"https://github.com/LambdaSchool/auth-i/pull/336","diff_url":"https://github.com/LambdaSchool/auth-i/pull/336.diff","patch_url":"https://github.com/LambdaSchool/auth-i/pull/336.patch","issue_url":"https://api.github.com/repos/LambdaSchool/auth-i/issues/336","number":336,"state":"open","locked":false,"title":"Tim Zulf MBP- WIP","user":{"login":"Tulf","id":6799924,"node_id":"MDQ6VXNlcjY3OTk5MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6799924?v=4","gravatar_id":"","url":"https://api.github.com/users/Tulf","html_url":"https://github.com/Tulf","followers_url":"https://api.github.com/users/Tulf/followers","following_url":"https://api.github.com/users/Tulf/following{/other_user}","gists_url":"https://api.github.com/users/Tulf/gists{/gist_id}","starred_url":"https://api.github.com/users/Tulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tulf/subscriptions","organizations_url":"https://api.github.com/users/Tulf/orgs","repos_url":"https://api.github.com/users/Tulf/repos","events_url":"https://api.github.com/users/Tulf/events{/privacy}","received_events_url":"https://api.github.com/users/Tulf/received_events","type":"User","site_admin":false},"body":"## Assignment\r\n\r\n**Part one, due Monday**: Use Node.js, Express and Knex to build an API that provides **Register** and **Login** functionality using SQLite to store _User_ information. Make sure the password is not stored as plain text.\r\n\r\n**Part two, due Tuesday**: Use **sessions** and **cookies** to keep a record of logged in users across requests.\r\n\r\n## Instructions\r\n\r\nYou will build the solution from scratch, no starter code is provided. Feel free to structure your API anyway you want, but aim at making it easy to maintain in the future.\r\n\r\n### Download Project Files\r\n\r\n- **Fork** and **Clone** this repository.\r\n- **CD into the folder** where you cloned the repository.\r\n- Do your magic!\r\n\r\n### Implement Requirements\r\n\r\n- Take the steps necessary to create a `package.json` to keep a record of all dependencies.\r\n- Configure an _npm script_ named _\"start\"_ that will execute your code using _nodemon_ so that the server restarts on changes. Make _nodemon_ be a development time dependency only, it shouldn't be deployed to production.\r\n- Design and build a set of endpoints listed below.\r\n- **Use _Postman_ to test the API as you work through the exercises.**\r\n\r\n#### Endpoints\r\n\r\n| Method | Endpoint      | Description                                                                                                                                                                                                                                                                                 |\r\n| ------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\r\n| POST   | /api/register | Creates a `user` using the information sent inside the `body` of the request. **Hash the password** before saving the user to the database.                                                                                                                                                 |\r\n| POST   | /api/login    | Use the credentials sent inside the `body` to authenticate the user. On successful login, create a new session for the user and send back a 'Logged in' message and a cookie that contains the user id. If login fails, respond with the correct status code and the message: 'You shall not pass!' |\r\n| GET    | /api/users    | If the user is logged in, respond with an array of all the users contained in the database. If the user is not logged in repond with the correct status code and the message: 'You shall not pass!'. Use this endpoint to verify that the password is hashed before it is saved.            |\r\n\r\n## Stretch Problem\r\n\r\n- Write a piece of **global** middleware that ensures a user is logged in when accessing _any_ route prefixed by `/api/restricted/`. For instance, `/api/restricted/something`, `/api/restricted/other`, and `/api/restricted/a` should all be protected by the middleware; only logged in users should be able to access these routes.\r\n- Build a React application that implements components to register, login and view a list of users. Gotta keep sharpening your React skills.","created_at":"2018-09-17T22:58:13Z","updated_at":"2018-09-18T22:48:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b32a6b0d4d417e69e2fa74e258ef7dfaac5065c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336/commits","review_comments_url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336/comments","review_comment_url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LambdaSchool/auth-i/issues/336/comments","statuses_url":"https://api.github.com/repos/LambdaSchool/auth-i/statuses/892369db1fd3611f898bee2b87cf147c6aff5cbd","head":{"label":"Tulf:master","ref":"master","sha":"892369db1fd3611f898bee2b87cf147c6aff5cbd","user":{"login":"Tulf","id":6799924,"node_id":"MDQ6VXNlcjY3OTk5MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6799924?v=4","gravatar_id":"","url":"https://api.github.com/users/Tulf","html_url":"https://github.com/Tulf","followers_url":"https://api.github.com/users/Tulf/followers","following_url":"https://api.github.com/users/Tulf/following{/other_user}","gists_url":"https://api.github.com/users/Tulf/gists{/gist_id}","starred_url":"https://api.github.com/users/Tulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tulf/subscriptions","organizations_url":"https://api.github.com/users/Tulf/orgs","repos_url":"https://api.github.com/users/Tulf/repos","events_url":"https://api.github.com/users/Tulf/events{/privacy}","received_events_url":"https://api.github.com/users/Tulf/received_events","type":"User","site_admin":false},"repo":{"id":149188755,"node_id":"MDEwOlJlcG9zaXRvcnkxNDkxODg3NTU=","name":"auth-i","full_name":"Tulf/auth-i","private":false,"owner":{"login":"Tulf","id":6799924,"node_id":"MDQ6VXNlcjY3OTk5MjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6799924?v=4","gravatar_id":"","url":"https://api.github.com/users/Tulf","html_url":"https://github.com/Tulf","followers_url":"https://api.github.com/users/Tulf/followers","following_url":"https://api.github.com/users/Tulf/following{/other_user}","gists_url":"https://api.github.com/users/Tulf/gists{/gist_id}","starred_url":"https://api.github.com/users/Tulf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tulf/subscriptions","organizations_url":"https://api.github.com/users/Tulf/orgs","repos_url":"https://api.github.com/users/Tulf/repos","events_url":"https://api.github.com/users/Tulf/events{/privacy}","received_events_url":"https://api.github.com/users/Tulf/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Tulf/auth-i","description":"Adding Authentication to an API using Sessions and Cookies","fork":true,"url":"https://api.github.com/repos/Tulf/auth-i","forks_url":"https://api.github.com/repos/Tulf/auth-i/forks","keys_url":"https://api.github.com/repos/Tulf/auth-i/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tulf/auth-i/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tulf/auth-i/teams","hooks_url":"https://api.github.com/repos/Tulf/auth-i/hooks","issue_events_url":"https://api.github.com/repos/Tulf/auth-i/issues/events{/number}","events_url":"https://api.github.com/repos/Tulf/auth-i/events","assignees_url":"https://api.github.com/repos/Tulf/auth-i/assignees{/user}","branches_url":"https://api.github.com/repos/Tulf/auth-i/branches{/branch}","tags_url":"https://api.github.com/repos/Tulf/auth-i/tags","blobs_url":"https://api.github.com/repos/Tulf/auth-i/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tulf/auth-i/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tulf/auth-i/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tulf/auth-i/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tulf/auth-i/statuses/{sha}","languages_url":"https://api.github.com/repos/Tulf/auth-i/languages","stargazers_url":"https://api.github.com/repos/Tulf/auth-i/stargazers","contributors_url":"https://api.github.com/repos/Tulf/auth-i/contributors","subscribers_url":"https://api.github.com/repos/Tulf/auth-i/subscribers","subscription_url":"https://api.github.com/repos/Tulf/auth-i/subscription","commits_url":"https://api.github.com/repos/Tulf/auth-i/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tulf/auth-i/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tulf/auth-i/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tulf/auth-i/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tulf/auth-i/contents/{+path}","compare_url":"https://api.github.com/repos/Tulf/auth-i/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tulf/auth-i/merges","archive_url":"https://api.github.com/repos/Tulf/auth-i/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tulf/auth-i/downloads","issues_url":"https://api.github.com/repos/Tulf/auth-i/issues{/number}","pulls_url":"https://api.github.com/repos/Tulf/auth-i/pulls{/number}","milestones_url":"https://api.github.com/repos/Tulf/auth-i/milestones{/number}","notifications_url":"https://api.github.com/repos/Tulf/auth-i/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tulf/auth-i/labels{/name}","releases_url":"https://api.github.com/repos/Tulf/auth-i/releases{/id}","deployments_url":"https://api.github.com/repos/Tulf/auth-i/deployments","created_at":"2018-09-17T21:13:24Z","updated_at":"2018-09-17T23:41:56Z","pushed_at":"2018-09-17T23:41:54Z","git_url":"git://github.com/Tulf/auth-i.git","ssh_url":"git@github.com:Tulf/auth-i.git","clone_url":"https://github.com/Tulf/auth-i.git","svn_url":"https://github.com/Tulf/auth-i","homepage":"","size":63,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"LambdaSchool:master","ref":"master","sha":"dbe64ae12854a67fab50aa109391a152aa3ebe01","user":{"login":"LambdaSchool","id":24780114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/24780114?v=4","gravatar_id":"","url":"https://api.github.com/users/LambdaSchool","html_url":"https://github.com/LambdaSchool","followers_url":"https://api.github.com/users/LambdaSchool/followers","following_url":"https://api.github.com/users/LambdaSchool/following{/other_user}","gists_url":"https://api.github.com/users/LambdaSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/LambdaSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LambdaSchool/subscriptions","organizations_url":"https://api.github.com/users/LambdaSchool/orgs","repos_url":"https://api.github.com/users/LambdaSchool/repos","events_url":"https://api.github.com/users/LambdaSchool/events{/privacy}","received_events_url":"https://api.github.com/users/LambdaSchool/received_events","type":"Organization","site_admin":false},"repo":{"id":101209425,"node_id":"MDEwOlJlcG9zaXRvcnkxMDEyMDk0MjU=","name":"auth-i","full_name":"LambdaSchool/auth-i","private":false,"owner":{"login":"LambdaSchool","id":24780114,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NzgwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/24780114?v=4","gravatar_id":"","url":"https://api.github.com/users/LambdaSchool","html_url":"https://github.com/LambdaSchool","followers_url":"https://api.github.com/users/LambdaSchool/followers","following_url":"https://api.github.com/users/LambdaSchool/following{/other_user}","gists_url":"https://api.github.com/users/LambdaSchool/gists{/gist_id}","starred_url":"https://api.github.com/users/LambdaSchool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LambdaSchool/subscriptions","organizations_url":"https://api.github.com/users/LambdaSchool/orgs","repos_url":"https://api.github.com/users/LambdaSchool/repos","events_url":"https://api.github.com/users/LambdaSchool/events{/privacy}","received_events_url":"https://api.github.com/users/LambdaSchool/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/LambdaSchool/auth-i","description":"Adding Authentication to an API using Sessions and Cookies","fork":false,"url":"https://api.github.com/repos/LambdaSchool/auth-i","forks_url":"https://api.github.com/repos/LambdaSchool/auth-i/forks","keys_url":"https://api.github.com/repos/LambdaSchool/auth-i/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LambdaSchool/auth-i/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LambdaSchool/auth-i/teams","hooks_url":"https://api.github.com/repos/LambdaSchool/auth-i/hooks","issue_events_url":"https://api.github.com/repos/LambdaSchool/auth-i/issues/events{/number}","events_url":"https://api.github.com/repos/LambdaSchool/auth-i/events","assignees_url":"https://api.github.com/repos/LambdaSchool/auth-i/assignees{/user}","branches_url":"https://api.github.com/repos/LambdaSchool/auth-i/branches{/branch}","tags_url":"https://api.github.com/repos/LambdaSchool/auth-i/tags","blobs_url":"https://api.github.com/repos/LambdaSchool/auth-i/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LambdaSchool/auth-i/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LambdaSchool/auth-i/git/refs{/sha}","trees_url":"https://api.github.com/repos/LambdaSchool/auth-i/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LambdaSchool/auth-i/statuses/{sha}","languages_url":"https://api.github.com/repos/LambdaSchool/auth-i/languages","stargazers_url":"https://api.github.com/repos/LambdaSchool/auth-i/stargazers","contributors_url":"https://api.github.com/repos/LambdaSchool/auth-i/contributors","subscribers_url":"https://api.github.com/repos/LambdaSchool/auth-i/subscribers","subscription_url":"https://api.github.com/repos/LambdaSchool/auth-i/subscription","commits_url":"https://api.github.com/repos/LambdaSchool/auth-i/commits{/sha}","git_commits_url":"https://api.github.com/repos/LambdaSchool/auth-i/git/commits{/sha}","comments_url":"https://api.github.com/repos/LambdaSchool/auth-i/comments{/number}","issue_comment_url":"https://api.github.com/repos/LambdaSchool/auth-i/issues/comments{/number}","contents_url":"https://api.github.com/repos/LambdaSchool/auth-i/contents/{+path}","compare_url":"https://api.github.com/repos/LambdaSchool/auth-i/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LambdaSchool/auth-i/merges","archive_url":"https://api.github.com/repos/LambdaSchool/auth-i/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LambdaSchool/auth-i/downloads","issues_url":"https://api.github.com/repos/LambdaSchool/auth-i/issues{/number}","pulls_url":"https://api.github.com/repos/LambdaSchool/auth-i/pulls{/number}","milestones_url":"https://api.github.com/repos/LambdaSchool/auth-i/milestones{/number}","notifications_url":"https://api.github.com/repos/LambdaSchool/auth-i/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LambdaSchool/auth-i/labels{/name}","releases_url":"https://api.github.com/repos/LambdaSchool/auth-i/releases{/id}","deployments_url":"https://api.github.com/repos/LambdaSchool/auth-i/deployments","created_at":"2017-08-23T17:52:22Z","updated_at":"2018-08-06T05:27:19Z","pushed_at":"2018-09-18T22:47:51Z","git_url":"git://github.com/LambdaSchool/auth-i.git","ssh_url":"git@github.com:LambdaSchool/auth-i.git","clone_url":"https://github.com/LambdaSchool/auth-i.git","svn_url":"https://github.com/LambdaSchool/auth-i","homepage":"","size":45,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":428,"mirror_url":null,"archived":false,"open_issues_count":274,"license":null,"forks":428,"open_issues":274,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336"},"html":{"href":"https://github.com/LambdaSchool/auth-i/pull/336"},"issue":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/issues/336"},"comments":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/issues/336/comments"},"review_comments":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336/comments"},"review_comment":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/pulls/336/commits"},"statuses":{"href":"https://api.github.com/repos/LambdaSchool/auth-i/statuses/892369db1fd3611f898bee2b87cf147c6aff5cbd"}},"author_association":"NONE"}}
{"actor":{"display_login":"Tulf"}}