{"action":"created","comment":{"url":"https://api.github.com/repos/thangngv95/init-project/pulls/comments/171635125","pull_request_review_id":100523681,"id":171635125,"diff_hunk":"@@ -28,5 +24,29 @@ def digest string\n         end\n       BCrypt::Password.create string, cost: cost\n     end\n+\n+    def new_token\n+      SecureRandom.urlsafe_base64\n+    end\n+  end\n+\n+  def remember\n+    @remember_token = User.new_token\n+    update_attributes remember_digest: User.digest(remember_token)\n+  end\n+\n+  def authenticated? remember_token\n+    return false unless remember_digest\n+    BCrypt::Password.new(remember_digest).is_password?(remember_token)","path":"app/models/user.rb","position":null,"original_position":44,"commit_id":"d62acebc4fee820e7969dc5bc8fc3ccd2f431c07","original_commit_id":"ff59a6156f94f82cf45b2292e77fb15f181a08a0","user":{"login":"thangngv95","id":35475293,"avatar_url":"https://avatars0.githubusercontent.com/u/35475293?v=4","gravatar_id":"","url":"https://api.github.com/users/thangngv95","html_url":"https://github.com/thangngv95","followers_url":"https://api.github.com/users/thangngv95/followers","following_url":"https://api.github.com/users/thangngv95/following{/other_user}","gists_url":"https://api.github.com/users/thangngv95/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngv95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngv95/subscriptions","organizations_url":"https://api.github.com/users/thangngv95/orgs","repos_url":"https://api.github.com/users/thangngv95/repos","events_url":"https://api.github.com/users/thangngv95/events{/privacy}","received_events_url":"https://api.github.com/users/thangngv95/received_events","type":"User","site_admin":false},"body":"đó là hàm authenticated?\r\nsau người dùng đăng nhập, tắt trình duyệt và bật lại thì nó sẽ kiểm tra remember_digest trong database và remember_token trong cookies nếu nó trùng thì đăng nhập bình thường còn sai thì sẽ phải đăng nhập lại","created_at":"2018-03-01T17:36:14Z","updated_at":"2018-03-01T17:36:14Z","html_url":"https://github.com/thangngv95/init-project/pull/22#discussion_r171635125","pull_request_url":"https://api.github.com/repos/thangngv95/init-project/pulls/22","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/thangngv95/init-project/pulls/comments/171635125"},"html":{"href":"https://github.com/thangngv95/init-project/pull/22#discussion_r171635125"},"pull_request":{"href":"https://api.github.com/repos/thangngv95/init-project/pulls/22"}},"in_reply_to_id":171172927},"pull_request":{"url":"https://api.github.com/repos/thangngv95/init-project/pulls/22","id":171662427,"html_url":"https://github.com/thangngv95/init-project/pull/22","diff_url":"https://github.com/thangngv95/init-project/pull/22.diff","patch_url":"https://github.com/thangngv95/init-project/pull/22.patch","issue_url":"https://api.github.com/repos/thangngv95/init-project/issues/22","number":22,"state":"open","locked":false,"title":"chap9","user":{"login":"thangngv95","id":35475293,"avatar_url":"https://avatars0.githubusercontent.com/u/35475293?v=4","gravatar_id":"","url":"https://api.github.com/users/thangngv95","html_url":"https://github.com/thangngv95","followers_url":"https://api.github.com/users/thangngv95/followers","following_url":"https://api.github.com/users/thangngv95/following{/other_user}","gists_url":"https://api.github.com/users/thangngv95/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngv95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngv95/subscriptions","organizations_url":"https://api.github.com/users/thangngv95/orgs","repos_url":"https://api.github.com/users/thangngv95/repos","events_url":"https://api.github.com/users/thangngv95/events{/privacy}","received_events_url":"https://api.github.com/users/thangngv95/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-27T13:30:05Z","updated_at":"2018-03-01T17:36:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7661281d4c564ebcbda11c1ebcd74080b3599fec","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/thangngv95/init-project/pulls/22/commits","review_comments_url":"https://api.github.com/repos/thangngv95/init-project/pulls/22/comments","review_comment_url":"https://api.github.com/repos/thangngv95/init-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thangngv95/init-project/issues/22/comments","statuses_url":"https://api.github.com/repos/thangngv95/init-project/statuses/d62acebc4fee820e7969dc5bc8fc3ccd2f431c07","head":{"label":"thangngv95:chapter9","ref":"chapter9","sha":"d62acebc4fee820e7969dc5bc8fc3ccd2f431c07","user":{"login":"thangngv95","id":35475293,"avatar_url":"https://avatars0.githubusercontent.com/u/35475293?v=4","gravatar_id":"","url":"https://api.github.com/users/thangngv95","html_url":"https://github.com/thangngv95","followers_url":"https://api.github.com/users/thangngv95/followers","following_url":"https://api.github.com/users/thangngv95/following{/other_user}","gists_url":"https://api.github.com/users/thangngv95/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngv95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngv95/subscriptions","organizations_url":"https://api.github.com/users/thangngv95/orgs","repos_url":"https://api.github.com/users/thangngv95/repos","events_url":"https://api.github.com/users/thangngv95/events{/privacy}","received_events_url":"https://api.github.com/users/thangngv95/received_events","type":"User","site_admin":false},"repo":{"id":118914234,"name":"init-project","full_name":"thangngv95/init-project","owner":{"login":"thangngv95","id":35475293,"avatar_url":"https://avatars0.githubusercontent.com/u/35475293?v=4","gravatar_id":"","url":"https://api.github.com/users/thangngv95","html_url":"https://github.com/thangngv95","followers_url":"https://api.github.com/users/thangngv95/followers","following_url":"https://api.github.com/users/thangngv95/following{/other_user}","gists_url":"https://api.github.com/users/thangngv95/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngv95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngv95/subscriptions","organizations_url":"https://api.github.com/users/thangngv95/orgs","repos_url":"https://api.github.com/users/thangngv95/repos","events_url":"https://api.github.com/users/thangngv95/events{/privacy}","received_events_url":"https://api.github.com/users/thangngv95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thangngv95/init-project","description":null,"fork":false,"url":"https://api.github.com/repos/thangngv95/init-project","forks_url":"https://api.github.com/repos/thangngv95/init-project/forks","keys_url":"https://api.github.com/repos/thangngv95/init-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thangngv95/init-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thangngv95/init-project/teams","hooks_url":"https://api.github.com/repos/thangngv95/init-project/hooks","issue_events_url":"https://api.github.com/repos/thangngv95/init-project/issues/events{/number}","events_url":"https://api.github.com/repos/thangngv95/init-project/events","assignees_url":"https://api.github.com/repos/thangngv95/init-project/assignees{/user}","branches_url":"https://api.github.com/repos/thangngv95/init-project/branches{/branch}","tags_url":"https://api.github.com/repos/thangngv95/init-project/tags","blobs_url":"https://api.github.com/repos/thangngv95/init-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thangngv95/init-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thangngv95/init-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/thangngv95/init-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thangngv95/init-project/statuses/{sha}","languages_url":"https://api.github.com/repos/thangngv95/init-project/languages","stargazers_url":"https://api.github.com/repos/thangngv95/init-project/stargazers","contributors_url":"https://api.github.com/repos/thangngv95/init-project/contributors","subscribers_url":"https://api.github.com/repos/thangngv95/init-project/subscribers","subscription_url":"https://api.github.com/repos/thangngv95/init-project/subscription","commits_url":"https://api.github.com/repos/thangngv95/init-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/thangngv95/init-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/thangngv95/init-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/thangngv95/init-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/thangngv95/init-project/contents/{+path}","compare_url":"https://api.github.com/repos/thangngv95/init-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thangngv95/init-project/merges","archive_url":"https://api.github.com/repos/thangngv95/init-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thangngv95/init-project/downloads","issues_url":"https://api.github.com/repos/thangngv95/init-project/issues{/number}","pulls_url":"https://api.github.com/repos/thangngv95/init-project/pulls{/number}","milestones_url":"https://api.github.com/repos/thangngv95/init-project/milestones{/number}","notifications_url":"https://api.github.com/repos/thangngv95/init-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thangngv95/init-project/labels{/name}","releases_url":"https://api.github.com/repos/thangngv95/init-project/releases{/id}","deployments_url":"https://api.github.com/repos/thangngv95/init-project/deployments","created_at":"2018-01-25T13:10:08Z","updated_at":"2018-01-26T07:29:00Z","pushed_at":"2018-02-28T09:12:05Z","git_url":"git://github.com/thangngv95/init-project.git","ssh_url":"git@github.com:thangngv95/init-project.git","clone_url":"https://github.com/thangngv95/init-project.git","svn_url":"https://github.com/thangngv95/init-project","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"thangngv95:master","ref":"master","sha":"c76eae62f4812cbbf832419eb7649c6cbee61567","user":{"login":"thangngv95","id":35475293,"avatar_url":"https://avatars0.githubusercontent.com/u/35475293?v=4","gravatar_id":"","url":"https://api.github.com/users/thangngv95","html_url":"https://github.com/thangngv95","followers_url":"https://api.github.com/users/thangngv95/followers","following_url":"https://api.github.com/users/thangngv95/following{/other_user}","gists_url":"https://api.github.com/users/thangngv95/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngv95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngv95/subscriptions","organizations_url":"https://api.github.com/users/thangngv95/orgs","repos_url":"https://api.github.com/users/thangngv95/repos","events_url":"https://api.github.com/users/thangngv95/events{/privacy}","received_events_url":"https://api.github.com/users/thangngv95/received_events","type":"User","site_admin":false},"repo":{"id":118914234,"name":"init-project","full_name":"thangngv95/init-project","owner":{"login":"thangngv95","id":35475293,"avatar_url":"https://avatars0.githubusercontent.com/u/35475293?v=4","gravatar_id":"","url":"https://api.github.com/users/thangngv95","html_url":"https://github.com/thangngv95","followers_url":"https://api.github.com/users/thangngv95/followers","following_url":"https://api.github.com/users/thangngv95/following{/other_user}","gists_url":"https://api.github.com/users/thangngv95/gists{/gist_id}","starred_url":"https://api.github.com/users/thangngv95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thangngv95/subscriptions","organizations_url":"https://api.github.com/users/thangngv95/orgs","repos_url":"https://api.github.com/users/thangngv95/repos","events_url":"https://api.github.com/users/thangngv95/events{/privacy}","received_events_url":"https://api.github.com/users/thangngv95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thangngv95/init-project","description":null,"fork":false,"url":"https://api.github.com/repos/thangngv95/init-project","forks_url":"https://api.github.com/repos/thangngv95/init-project/forks","keys_url":"https://api.github.com/repos/thangngv95/init-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thangngv95/init-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thangngv95/init-project/teams","hooks_url":"https://api.github.com/repos/thangngv95/init-project/hooks","issue_events_url":"https://api.github.com/repos/thangngv95/init-project/issues/events{/number}","events_url":"https://api.github.com/repos/thangngv95/init-project/events","assignees_url":"https://api.github.com/repos/thangngv95/init-project/assignees{/user}","branches_url":"https://api.github.com/repos/thangngv95/init-project/branches{/branch}","tags_url":"https://api.github.com/repos/thangngv95/init-project/tags","blobs_url":"https://api.github.com/repos/thangngv95/init-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thangngv95/init-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thangngv95/init-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/thangngv95/init-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thangngv95/init-project/statuses/{sha}","languages_url":"https://api.github.com/repos/thangngv95/init-project/languages","stargazers_url":"https://api.github.com/repos/thangngv95/init-project/stargazers","contributors_url":"https://api.github.com/repos/thangngv95/init-project/contributors","subscribers_url":"https://api.github.com/repos/thangngv95/init-project/subscribers","subscription_url":"https://api.github.com/repos/thangngv95/init-project/subscription","commits_url":"https://api.github.com/repos/thangngv95/init-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/thangngv95/init-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/thangngv95/init-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/thangngv95/init-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/thangngv95/init-project/contents/{+path}","compare_url":"https://api.github.com/repos/thangngv95/init-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thangngv95/init-project/merges","archive_url":"https://api.github.com/repos/thangngv95/init-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thangngv95/init-project/downloads","issues_url":"https://api.github.com/repos/thangngv95/init-project/issues{/number}","pulls_url":"https://api.github.com/repos/thangngv95/init-project/pulls{/number}","milestones_url":"https://api.github.com/repos/thangngv95/init-project/milestones{/number}","notifications_url":"https://api.github.com/repos/thangngv95/init-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thangngv95/init-project/labels{/name}","releases_url":"https://api.github.com/repos/thangngv95/init-project/releases{/id}","deployments_url":"https://api.github.com/repos/thangngv95/init-project/deployments","created_at":"2018-01-25T13:10:08Z","updated_at":"2018-01-26T07:29:00Z","pushed_at":"2018-02-28T09:12:05Z","git_url":"git://github.com/thangngv95/init-project.git","ssh_url":"git@github.com:thangngv95/init-project.git","clone_url":"https://github.com/thangngv95/init-project.git","svn_url":"https://github.com/thangngv95/init-project","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thangngv95/init-project/pulls/22"},"html":{"href":"https://github.com/thangngv95/init-project/pull/22"},"issue":{"href":"https://api.github.com/repos/thangngv95/init-project/issues/22"},"comments":{"href":"https://api.github.com/repos/thangngv95/init-project/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/thangngv95/init-project/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/thangngv95/init-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thangngv95/init-project/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/thangngv95/init-project/statuses/d62acebc4fee820e7969dc5bc8fc3ccd2f431c07"}},"author_association":"OWNER"}}
{"actor":{"display_login":"thangngv95"}}