{"action":"created","comment":{"url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/comments/68984283","id":68984283,"diff_hunk":"@@ -13,15 +14,22 @@ angular.module('app').run(function ($rootScope, $state, $log, AuthService) {\n   $rootScope.$on('$stateChangeError', function (e, toState, toStateParams, fromState, fromStateParams, error) {\n     $log.log('$stateChangeError', error, e);\n     e.preventDefault();\n+\n     if (error.message == \"LoginRequired\") {\n       $rootScope.$broadcast('login:required');\n     }\n   });\n \n   $rootScope.$on('$gandalfError', function (e, data) {\n-    if (data.status == 401) {\n-      AuthService.logout();\n-      $rootScope.$broadcast('login:required');\n+    if (data.status === 401 && !isRefreshToken) {\n+      isRefreshToken = true;\n+\n+      AuthService.refreshToken().then(function () {\n+        window.location.reload();","path":"src/js/services/auth.js","position":27,"original_position":27,"commit_id":"29bf109a0767de21c102a1e7787b22e01e01f912","original_commit_id":"29bf109a0767de21c102a1e7787b22e01e01f912","user":{"login":"AndrewDryga","id":1877644,"avatar_url":"https://avatars.githubusercontent.com/u/1877644?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewDryga","html_url":"https://github.com/AndrewDryga","followers_url":"https://api.github.com/users/AndrewDryga/followers","following_url":"https://api.github.com/users/AndrewDryga/following{/other_user}","gists_url":"https://api.github.com/users/AndrewDryga/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewDryga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewDryga/subscriptions","organizations_url":"https://api.github.com/users/AndrewDryga/orgs","repos_url":"https://api.github.com/users/AndrewDryga/repos","events_url":"https://api.github.com/users/AndrewDryga/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewDryga/received_events","type":"User","site_admin":false},"body":"Давай этот вариант реализуем, чтобы данные не терялись. Бывает сложную таблицу редактирует, будут психовать если не сохранится :)","created_at":"2016-06-29T16:50:51Z","updated_at":"2016-06-29T16:50:51Z","html_url":"https://github.com/Nebo15/gandalf.web/pull/90#discussion_r68984283","pull_request_url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/comments/68984283"},"html":{"href":"https://github.com/Nebo15/gandalf.web/pull/90#discussion_r68984283"},"pull_request":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90","id":75665627,"html_url":"https://github.com/Nebo15/gandalf.web/pull/90","diff_url":"https://github.com/Nebo15/gandalf.web/pull/90.diff","patch_url":"https://github.com/Nebo15/gandalf.web/pull/90.patch","issue_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues/90","number":90,"state":"open","locked":false,"title":"Refresh token","user":{"login":"Satanpit","id":2317640,"avatar_url":"https://avatars.githubusercontent.com/u/2317640?v=3","gravatar_id":"","url":"https://api.github.com/users/Satanpit","html_url":"https://github.com/Satanpit","followers_url":"https://api.github.com/users/Satanpit/followers","following_url":"https://api.github.com/users/Satanpit/following{/other_user}","gists_url":"https://api.github.com/users/Satanpit/gists{/gist_id}","starred_url":"https://api.github.com/users/Satanpit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Satanpit/subscriptions","organizations_url":"https://api.github.com/users/Satanpit/orgs","repos_url":"https://api.github.com/users/Satanpit/repos","events_url":"https://api.github.com/users/Satanpit/events{/privacy}","received_events_url":"https://api.github.com/users/Satanpit/received_events","type":"User","site_admin":false},"body":"https://nebo15.atlassian.net/browse/GDF-472","created_at":"2016-06-29T15:07:40Z","updated_at":"2016-06-29T16:50:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e8589a4f60cc8d3b78e257ca73583b597bc5dd2","assignee":{"login":"alexeybondarenko","id":3592553,"avatar_url":"https://avatars.githubusercontent.com/u/3592553?v=3","gravatar_id":"","url":"https://api.github.com/users/alexeybondarenko","html_url":"https://github.com/alexeybondarenko","followers_url":"https://api.github.com/users/alexeybondarenko/followers","following_url":"https://api.github.com/users/alexeybondarenko/following{/other_user}","gists_url":"https://api.github.com/users/alexeybondarenko/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeybondarenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeybondarenko/subscriptions","organizations_url":"https://api.github.com/users/alexeybondarenko/orgs","repos_url":"https://api.github.com/users/alexeybondarenko/repos","events_url":"https://api.github.com/users/alexeybondarenko/events{/privacy}","received_events_url":"https://api.github.com/users/alexeybondarenko/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexeybondarenko","id":3592553,"avatar_url":"https://avatars.githubusercontent.com/u/3592553?v=3","gravatar_id":"","url":"https://api.github.com/users/alexeybondarenko","html_url":"https://github.com/alexeybondarenko","followers_url":"https://api.github.com/users/alexeybondarenko/followers","following_url":"https://api.github.com/users/alexeybondarenko/following{/other_user}","gists_url":"https://api.github.com/users/alexeybondarenko/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeybondarenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeybondarenko/subscriptions","organizations_url":"https://api.github.com/users/alexeybondarenko/orgs","repos_url":"https://api.github.com/users/alexeybondarenko/repos","events_url":"https://api.github.com/users/alexeybondarenko/events{/privacy}","received_events_url":"https://api.github.com/users/alexeybondarenko/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90/commits","review_comments_url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90/comments","review_comment_url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues/90/comments","statuses_url":"https://api.github.com/repos/Nebo15/gandalf.web/statuses/29bf109a0767de21c102a1e7787b22e01e01f912","head":{"label":"Nebo15:GDF-472","ref":"GDF-472","sha":"29bf109a0767de21c102a1e7787b22e01e01f912","user":{"login":"Nebo15","id":5442866,"avatar_url":"https://avatars.githubusercontent.com/u/5442866?v=3","gravatar_id":"","url":"https://api.github.com/users/Nebo15","html_url":"https://github.com/Nebo15","followers_url":"https://api.github.com/users/Nebo15/followers","following_url":"https://api.github.com/users/Nebo15/following{/other_user}","gists_url":"https://api.github.com/users/Nebo15/gists{/gist_id}","starred_url":"https://api.github.com/users/Nebo15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nebo15/subscriptions","organizations_url":"https://api.github.com/users/Nebo15/orgs","repos_url":"https://api.github.com/users/Nebo15/repos","events_url":"https://api.github.com/users/Nebo15/events{/privacy}","received_events_url":"https://api.github.com/users/Nebo15/received_events","type":"Organization","site_admin":false},"repo":{"id":51602628,"name":"gandalf.web","full_name":"Nebo15/gandalf.web","owner":{"login":"Nebo15","id":5442866,"avatar_url":"https://avatars.githubusercontent.com/u/5442866?v=3","gravatar_id":"","url":"https://api.github.com/users/Nebo15","html_url":"https://github.com/Nebo15","followers_url":"https://api.github.com/users/Nebo15/followers","following_url":"https://api.github.com/users/Nebo15/following{/other_user}","gists_url":"https://api.github.com/users/Nebo15/gists{/gist_id}","starred_url":"https://api.github.com/users/Nebo15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nebo15/subscriptions","organizations_url":"https://api.github.com/users/Nebo15/orgs","repos_url":"https://api.github.com/users/Nebo15/repos","events_url":"https://api.github.com/users/Nebo15/events{/privacy}","received_events_url":"https://api.github.com/users/Nebo15/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nebo15/gandalf.web","description":"Open-Source Decision Engine and Scoring Table for Big-Data.","fork":false,"url":"https://api.github.com/repos/Nebo15/gandalf.web","forks_url":"https://api.github.com/repos/Nebo15/gandalf.web/forks","keys_url":"https://api.github.com/repos/Nebo15/gandalf.web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nebo15/gandalf.web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nebo15/gandalf.web/teams","hooks_url":"https://api.github.com/repos/Nebo15/gandalf.web/hooks","issue_events_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues/events{/number}","events_url":"https://api.github.com/repos/Nebo15/gandalf.web/events","assignees_url":"https://api.github.com/repos/Nebo15/gandalf.web/assignees{/user}","branches_url":"https://api.github.com/repos/Nebo15/gandalf.web/branches{/branch}","tags_url":"https://api.github.com/repos/Nebo15/gandalf.web/tags","blobs_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nebo15/gandalf.web/statuses/{sha}","languages_url":"https://api.github.com/repos/Nebo15/gandalf.web/languages","stargazers_url":"https://api.github.com/repos/Nebo15/gandalf.web/stargazers","contributors_url":"https://api.github.com/repos/Nebo15/gandalf.web/contributors","subscribers_url":"https://api.github.com/repos/Nebo15/gandalf.web/subscribers","subscription_url":"https://api.github.com/repos/Nebo15/gandalf.web/subscription","commits_url":"https://api.github.com/repos/Nebo15/gandalf.web/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nebo15/gandalf.web/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nebo15/gandalf.web/contents/{+path}","compare_url":"https://api.github.com/repos/Nebo15/gandalf.web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nebo15/gandalf.web/merges","archive_url":"https://api.github.com/repos/Nebo15/gandalf.web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nebo15/gandalf.web/downloads","issues_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues{/number}","pulls_url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls{/number}","milestones_url":"https://api.github.com/repos/Nebo15/gandalf.web/milestones{/number}","notifications_url":"https://api.github.com/repos/Nebo15/gandalf.web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nebo15/gandalf.web/labels{/name}","releases_url":"https://api.github.com/repos/Nebo15/gandalf.web/releases{/id}","deployments_url":"https://api.github.com/repos/Nebo15/gandalf.web/deployments","created_at":"2016-02-12T16:57:48Z","updated_at":"2016-05-29T20:46:24Z","pushed_at":"2016-06-29T15:48:36Z","git_url":"git://github.com/Nebo15/gandalf.web.git","ssh_url":"git@github.com:Nebo15/gandalf.web.git","clone_url":"https://github.com/Nebo15/gandalf.web.git","svn_url":"https://github.com/Nebo15/gandalf.web","homepage":"http://gndf.io/","size":4217,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":2,"default_branch":"develop"}},"base":{"label":"Nebo15:develop","ref":"develop","sha":"e23f32ec4838f58f418d26959289eeee774feaab","user":{"login":"Nebo15","id":5442866,"avatar_url":"https://avatars.githubusercontent.com/u/5442866?v=3","gravatar_id":"","url":"https://api.github.com/users/Nebo15","html_url":"https://github.com/Nebo15","followers_url":"https://api.github.com/users/Nebo15/followers","following_url":"https://api.github.com/users/Nebo15/following{/other_user}","gists_url":"https://api.github.com/users/Nebo15/gists{/gist_id}","starred_url":"https://api.github.com/users/Nebo15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nebo15/subscriptions","organizations_url":"https://api.github.com/users/Nebo15/orgs","repos_url":"https://api.github.com/users/Nebo15/repos","events_url":"https://api.github.com/users/Nebo15/events{/privacy}","received_events_url":"https://api.github.com/users/Nebo15/received_events","type":"Organization","site_admin":false},"repo":{"id":51602628,"name":"gandalf.web","full_name":"Nebo15/gandalf.web","owner":{"login":"Nebo15","id":5442866,"avatar_url":"https://avatars.githubusercontent.com/u/5442866?v=3","gravatar_id":"","url":"https://api.github.com/users/Nebo15","html_url":"https://github.com/Nebo15","followers_url":"https://api.github.com/users/Nebo15/followers","following_url":"https://api.github.com/users/Nebo15/following{/other_user}","gists_url":"https://api.github.com/users/Nebo15/gists{/gist_id}","starred_url":"https://api.github.com/users/Nebo15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nebo15/subscriptions","organizations_url":"https://api.github.com/users/Nebo15/orgs","repos_url":"https://api.github.com/users/Nebo15/repos","events_url":"https://api.github.com/users/Nebo15/events{/privacy}","received_events_url":"https://api.github.com/users/Nebo15/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nebo15/gandalf.web","description":"Open-Source Decision Engine and Scoring Table for Big-Data.","fork":false,"url":"https://api.github.com/repos/Nebo15/gandalf.web","forks_url":"https://api.github.com/repos/Nebo15/gandalf.web/forks","keys_url":"https://api.github.com/repos/Nebo15/gandalf.web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nebo15/gandalf.web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nebo15/gandalf.web/teams","hooks_url":"https://api.github.com/repos/Nebo15/gandalf.web/hooks","issue_events_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues/events{/number}","events_url":"https://api.github.com/repos/Nebo15/gandalf.web/events","assignees_url":"https://api.github.com/repos/Nebo15/gandalf.web/assignees{/user}","branches_url":"https://api.github.com/repos/Nebo15/gandalf.web/branches{/branch}","tags_url":"https://api.github.com/repos/Nebo15/gandalf.web/tags","blobs_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nebo15/gandalf.web/statuses/{sha}","languages_url":"https://api.github.com/repos/Nebo15/gandalf.web/languages","stargazers_url":"https://api.github.com/repos/Nebo15/gandalf.web/stargazers","contributors_url":"https://api.github.com/repos/Nebo15/gandalf.web/contributors","subscribers_url":"https://api.github.com/repos/Nebo15/gandalf.web/subscribers","subscription_url":"https://api.github.com/repos/Nebo15/gandalf.web/subscription","commits_url":"https://api.github.com/repos/Nebo15/gandalf.web/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nebo15/gandalf.web/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nebo15/gandalf.web/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nebo15/gandalf.web/contents/{+path}","compare_url":"https://api.github.com/repos/Nebo15/gandalf.web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nebo15/gandalf.web/merges","archive_url":"https://api.github.com/repos/Nebo15/gandalf.web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nebo15/gandalf.web/downloads","issues_url":"https://api.github.com/repos/Nebo15/gandalf.web/issues{/number}","pulls_url":"https://api.github.com/repos/Nebo15/gandalf.web/pulls{/number}","milestones_url":"https://api.github.com/repos/Nebo15/gandalf.web/milestones{/number}","notifications_url":"https://api.github.com/repos/Nebo15/gandalf.web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nebo15/gandalf.web/labels{/name}","releases_url":"https://api.github.com/repos/Nebo15/gandalf.web/releases{/id}","deployments_url":"https://api.github.com/repos/Nebo15/gandalf.web/deployments","created_at":"2016-02-12T16:57:48Z","updated_at":"2016-05-29T20:46:24Z","pushed_at":"2016-06-29T15:48:36Z","git_url":"git://github.com/Nebo15/gandalf.web.git","ssh_url":"git@github.com:Nebo15/gandalf.web.git","clone_url":"https://github.com/Nebo15/gandalf.web.git","svn_url":"https://github.com/Nebo15/gandalf.web","homepage":"http://gndf.io/","size":4217,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90"},"html":{"href":"https://github.com/Nebo15/gandalf.web/pull/90"},"issue":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/issues/90"},"comments":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/Nebo15/gandalf.web/statuses/29bf109a0767de21c102a1e7787b22e01e01f912"}}}}
{"actor":{"display_login":"AndrewDryga"}}