{"action":"created","comment":{"url":"https://api.github.com/repos/akveo/nebular/pulls/comments/211847767","pull_request_review_id":148353910,"id":211847767,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTg0Nzc2Nw==","diff_hunk":"@@ -34,14 +34,40 @@ export class NbAuthService {\n   }\n \n   /**\n-   * Returns true if auth token is presented in the token storage\n-   * @returns {Observable<any>}\n+   * Returns true if auth token is present in the token storage\n+   * @returns {Observable<boolean>}\n    */\n   isAuthenticated(): Observable<boolean> {\n     return this.getToken()\n       .pipe(map((token: NbAuthToken) => token.isValid()));\n   }\n \n+  /**\n+   * Returns true if valid auth token is present in the token storage.\n+   * If not, calls the strategy refreshToken, and returns isAuthenticated() if success, false otherwise\n+   * @returns {Observable<boolean>}\n+   */\n+  isAuthenticatedOrRefresh(): Observable<boolean> {\n+    return this.getToken()\n+      .pipe(\n+        switchMap(token => {\n+        if (!token.isValid()) {\n+          return this.refreshToken(token.getOwnerStrategyName(), token)","path":"src/framework/auth/services/auth.service.ts","position":24,"original_position":24,"commit_id":"0e23673b8b4d7e0dbc123c3139627b3e0f601841","original_commit_id":"0e23673b8b4d7e0dbc123c3139627b3e0f601841","user":{"login":"cloakedch","id":32439069,"node_id":"MDQ6VXNlcjMyNDM5MDY5","avatar_url":"https://avatars1.githubusercontent.com/u/32439069?v=4","gravatar_id":"","url":"https://api.github.com/users/cloakedch","html_url":"https://github.com/cloakedch","followers_url":"https://api.github.com/users/cloakedch/followers","following_url":"https://api.github.com/users/cloakedch/following{/other_user}","gists_url":"https://api.github.com/users/cloakedch/gists{/gist_id}","starred_url":"https://api.github.com/users/cloakedch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloakedch/subscriptions","organizations_url":"https://api.github.com/users/cloakedch/orgs","repos_url":"https://api.github.com/users/cloakedch/repos","events_url":"https://api.github.com/users/cloakedch/events{/privacy}","received_events_url":"https://api.github.com/users/cloakedch/received_events","type":"User","site_admin":false},"body":"OK, I guess the API I am using is then not working according to the RFC.\r\nThanks for clearing that up!","created_at":"2018-08-22T07:05:16Z","updated_at":"2018-08-22T07:05:16Z","html_url":"https://github.com/akveo/nebular/pull/649#discussion_r211847767","pull_request_url":"https://api.github.com/repos/akveo/nebular/pulls/649","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/akveo/nebular/pulls/comments/211847767"},"html":{"href":"https://github.com/akveo/nebular/pull/649#discussion_r211847767"},"pull_request":{"href":"https://api.github.com/repos/akveo/nebular/pulls/649"}},"in_reply_to_id":211834169},"pull_request":{"url":"https://api.github.com/repos/akveo/nebular/pulls/649","id":209299083,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5Mjk5MDgz","html_url":"https://github.com/akveo/nebular/pull/649","diff_url":"https://github.com/akveo/nebular/pull/649.diff","patch_url":"https://github.com/akveo/nebular/pull/649.patch","issue_url":"https://api.github.com/repos/akveo/nebular/issues/649","number":649,"state":"open","locked":false,"title":"Feat/Auth : refreshToken request automatically sent by NbAuthService if isAuthenticatedOrRefresh is called","user":{"login":"alain-charles","id":40032406,"node_id":"MDQ6VXNlcjQwMDMyNDA2","avatar_url":"https://avatars0.githubusercontent.com/u/40032406?v=4","gravatar_id":"","url":"https://api.github.com/users/alain-charles","html_url":"https://github.com/alain-charles","followers_url":"https://api.github.com/users/alain-charles/followers","following_url":"https://api.github.com/users/alain-charles/following{/other_user}","gists_url":"https://api.github.com/users/alain-charles/gists{/gist_id}","starred_url":"https://api.github.com/users/alain-charles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alain-charles/subscriptions","organizations_url":"https://api.github.com/users/alain-charles/orgs","repos_url":"https://api.github.com/users/alain-charles/repos","events_url":"https://api.github.com/users/alain-charles/events{/privacy}","received_events_url":"https://api.github.com/users/alain-charles/received_events","type":"User","site_admin":false},"body":"Feat/Auth :\r\n\r\n- refreshToken request automatically sent by `NbAuthService` if `isAuthenticatedOrRefresh()` is called\r\n- `NbAuthJWTInterceptor` now calls `NbAuthService.isAuthenticatedOrRefresh()`\r\n\r\nPOTENTIAL BREAKING CHANGE if `NbAuthJWTInterceptor` is used :\r\nThe developper has now to provide in his auth_module a function `filterInterceptorRequest(req: HttpRequest<any>):boolean` that returns true if req.url must not be intercepted for bearer token injection.\r\nThe auth urls MUST be included there.\r\n\r\n```\r\nexport function filterInterceptorRequest(req: HttpRequest<any>) {\r\n  return ['http://localhost:4400/api/auth/',\r\n              'http://other.url/with/no/token/injected/',\r\n         ]\r\n    .some(url => req.url.includes(url));\r\n}\r\n....\r\n{ provide: NB_AUTH_TOKEN_INTERCEPTOR_FILTER, useValue: filterInterceptorRequest},\r\n```\r\n\r\nPlayground sample follows.","created_at":"2018-08-18T07:10:14Z","updated_at":"2018-08-22T07:05:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a640445b18f5303541626ebb9e753464e779e8af","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/akveo/nebular/pulls/649/commits","review_comments_url":"https://api.github.com/repos/akveo/nebular/pulls/649/comments","review_comment_url":"https://api.github.com/repos/akveo/nebular/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akveo/nebular/issues/649/comments","statuses_url":"https://api.github.com/repos/akveo/nebular/statuses/0e23673b8b4d7e0dbc123c3139627b3e0f601841","head":{"label":"alain-charles:master","ref":"master","sha":"0e23673b8b4d7e0dbc123c3139627b3e0f601841","user":{"login":"alain-charles","id":40032406,"node_id":"MDQ6VXNlcjQwMDMyNDA2","avatar_url":"https://avatars0.githubusercontent.com/u/40032406?v=4","gravatar_id":"","url":"https://api.github.com/users/alain-charles","html_url":"https://github.com/alain-charles","followers_url":"https://api.github.com/users/alain-charles/followers","following_url":"https://api.github.com/users/alain-charles/following{/other_user}","gists_url":"https://api.github.com/users/alain-charles/gists{/gist_id}","starred_url":"https://api.github.com/users/alain-charles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alain-charles/subscriptions","organizations_url":"https://api.github.com/users/alain-charles/orgs","repos_url":"https://api.github.com/users/alain-charles/repos","events_url":"https://api.github.com/users/alain-charles/events{/privacy}","received_events_url":"https://api.github.com/users/alain-charles/received_events","type":"User","site_admin":false},"repo":{"id":138839483,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg4Mzk0ODM=","name":"nebular","full_name":"alain-charles/nebular","owner":{"login":"alain-charles","id":40032406,"node_id":"MDQ6VXNlcjQwMDMyNDA2","avatar_url":"https://avatars0.githubusercontent.com/u/40032406?v=4","gravatar_id":"","url":"https://api.github.com/users/alain-charles","html_url":"https://github.com/alain-charles","followers_url":"https://api.github.com/users/alain-charles/followers","following_url":"https://api.github.com/users/alain-charles/following{/other_user}","gists_url":"https://api.github.com/users/alain-charles/gists{/gist_id}","starred_url":"https://api.github.com/users/alain-charles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alain-charles/subscriptions","organizations_url":"https://api.github.com/users/alain-charles/orgs","repos_url":"https://api.github.com/users/alain-charles/repos","events_url":"https://api.github.com/users/alain-charles/events{/privacy}","received_events_url":"https://api.github.com/users/alain-charles/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alain-charles/nebular","description":"Nebular is a set of essential modules for your next Angular 6 application.","fork":true,"url":"https://api.github.com/repos/alain-charles/nebular","forks_url":"https://api.github.com/repos/alain-charles/nebular/forks","keys_url":"https://api.github.com/repos/alain-charles/nebular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alain-charles/nebular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alain-charles/nebular/teams","hooks_url":"https://api.github.com/repos/alain-charles/nebular/hooks","issue_events_url":"https://api.github.com/repos/alain-charles/nebular/issues/events{/number}","events_url":"https://api.github.com/repos/alain-charles/nebular/events","assignees_url":"https://api.github.com/repos/alain-charles/nebular/assignees{/user}","branches_url":"https://api.github.com/repos/alain-charles/nebular/branches{/branch}","tags_url":"https://api.github.com/repos/alain-charles/nebular/tags","blobs_url":"https://api.github.com/repos/alain-charles/nebular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alain-charles/nebular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alain-charles/nebular/git/refs{/sha}","trees_url":"https://api.github.com/repos/alain-charles/nebular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alain-charles/nebular/statuses/{sha}","languages_url":"https://api.github.com/repos/alain-charles/nebular/languages","stargazers_url":"https://api.github.com/repos/alain-charles/nebular/stargazers","contributors_url":"https://api.github.com/repos/alain-charles/nebular/contributors","subscribers_url":"https://api.github.com/repos/alain-charles/nebular/subscribers","subscription_url":"https://api.github.com/repos/alain-charles/nebular/subscription","commits_url":"https://api.github.com/repos/alain-charles/nebular/commits{/sha}","git_commits_url":"https://api.github.com/repos/alain-charles/nebular/git/commits{/sha}","comments_url":"https://api.github.com/repos/alain-charles/nebular/comments{/number}","issue_comment_url":"https://api.github.com/repos/alain-charles/nebular/issues/comments{/number}","contents_url":"https://api.github.com/repos/alain-charles/nebular/contents/{+path}","compare_url":"https://api.github.com/repos/alain-charles/nebular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alain-charles/nebular/merges","archive_url":"https://api.github.com/repos/alain-charles/nebular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alain-charles/nebular/downloads","issues_url":"https://api.github.com/repos/alain-charles/nebular/issues{/number}","pulls_url":"https://api.github.com/repos/alain-charles/nebular/pulls{/number}","milestones_url":"https://api.github.com/repos/alain-charles/nebular/milestones{/number}","notifications_url":"https://api.github.com/repos/alain-charles/nebular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alain-charles/nebular/labels{/name}","releases_url":"https://api.github.com/repos/alain-charles/nebular/releases{/id}","deployments_url":"https://api.github.com/repos/alain-charles/nebular/deployments","created_at":"2018-06-27T06:32:11Z","updated_at":"2018-08-21T17:39:57Z","pushed_at":"2018-08-21T17:39:55Z","git_url":"git://github.com/alain-charles/nebular.git","ssh_url":"git@github.com:alain-charles/nebular.git","clone_url":"https://github.com/alain-charles/nebular.git","svn_url":"https://github.com/alain-charles/nebular","homepage":"https://akveo.github.io/nebular","size":55732,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"akveo:master","ref":"master","sha":"efa16eff4f326cf1325fb4c4d1a882238dfa2d77","user":{"login":"akveo","id":11921694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExOTIxNjk0","avatar_url":"https://avatars3.githubusercontent.com/u/11921694?v=4","gravatar_id":"","url":"https://api.github.com/users/akveo","html_url":"https://github.com/akveo","followers_url":"https://api.github.com/users/akveo/followers","following_url":"https://api.github.com/users/akveo/following{/other_user}","gists_url":"https://api.github.com/users/akveo/gists{/gist_id}","starred_url":"https://api.github.com/users/akveo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akveo/subscriptions","organizations_url":"https://api.github.com/users/akveo/orgs","repos_url":"https://api.github.com/users/akveo/repos","events_url":"https://api.github.com/users/akveo/events{/privacy}","received_events_url":"https://api.github.com/users/akveo/received_events","type":"Organization","site_admin":false},"repo":{"id":104188467,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQxODg0Njc=","name":"nebular","full_name":"akveo/nebular","owner":{"login":"akveo","id":11921694,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExOTIxNjk0","avatar_url":"https://avatars3.githubusercontent.com/u/11921694?v=4","gravatar_id":"","url":"https://api.github.com/users/akveo","html_url":"https://github.com/akveo","followers_url":"https://api.github.com/users/akveo/followers","following_url":"https://api.github.com/users/akveo/following{/other_user}","gists_url":"https://api.github.com/users/akveo/gists{/gist_id}","starred_url":"https://api.github.com/users/akveo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akveo/subscriptions","organizations_url":"https://api.github.com/users/akveo/orgs","repos_url":"https://api.github.com/users/akveo/repos","events_url":"https://api.github.com/users/akveo/events{/privacy}","received_events_url":"https://api.github.com/users/akveo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akveo/nebular","description":"Nebular is a set of essential modules for your next Angular 6 application.","fork":false,"url":"https://api.github.com/repos/akveo/nebular","forks_url":"https://api.github.com/repos/akveo/nebular/forks","keys_url":"https://api.github.com/repos/akveo/nebular/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akveo/nebular/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akveo/nebular/teams","hooks_url":"https://api.github.com/repos/akveo/nebular/hooks","issue_events_url":"https://api.github.com/repos/akveo/nebular/issues/events{/number}","events_url":"https://api.github.com/repos/akveo/nebular/events","assignees_url":"https://api.github.com/repos/akveo/nebular/assignees{/user}","branches_url":"https://api.github.com/repos/akveo/nebular/branches{/branch}","tags_url":"https://api.github.com/repos/akveo/nebular/tags","blobs_url":"https://api.github.com/repos/akveo/nebular/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akveo/nebular/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akveo/nebular/git/refs{/sha}","trees_url":"https://api.github.com/repos/akveo/nebular/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akveo/nebular/statuses/{sha}","languages_url":"https://api.github.com/repos/akveo/nebular/languages","stargazers_url":"https://api.github.com/repos/akveo/nebular/stargazers","contributors_url":"https://api.github.com/repos/akveo/nebular/contributors","subscribers_url":"https://api.github.com/repos/akveo/nebular/subscribers","subscription_url":"https://api.github.com/repos/akveo/nebular/subscription","commits_url":"https://api.github.com/repos/akveo/nebular/commits{/sha}","git_commits_url":"https://api.github.com/repos/akveo/nebular/git/commits{/sha}","comments_url":"https://api.github.com/repos/akveo/nebular/comments{/number}","issue_comment_url":"https://api.github.com/repos/akveo/nebular/issues/comments{/number}","contents_url":"https://api.github.com/repos/akveo/nebular/contents/{+path}","compare_url":"https://api.github.com/repos/akveo/nebular/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akveo/nebular/merges","archive_url":"https://api.github.com/repos/akveo/nebular/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akveo/nebular/downloads","issues_url":"https://api.github.com/repos/akveo/nebular/issues{/number}","pulls_url":"https://api.github.com/repos/akveo/nebular/pulls{/number}","milestones_url":"https://api.github.com/repos/akveo/nebular/milestones{/number}","notifications_url":"https://api.github.com/repos/akveo/nebular/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akveo/nebular/labels{/name}","releases_url":"https://api.github.com/repos/akveo/nebular/releases{/id}","deployments_url":"https://api.github.com/repos/akveo/nebular/deployments","created_at":"2017-09-20T08:33:06Z","updated_at":"2018-08-21T16:57:02Z","pushed_at":"2018-08-21T17:39:56Z","git_url":"git://github.com/akveo/nebular.git","ssh_url":"git@github.com:akveo/nebular.git","clone_url":"https://github.com/akveo/nebular.git","svn_url":"https://github.com/akveo/nebular","homepage":"https://akveo.github.io/nebular","size":56044,"stargazers_count":1964,"watchers_count":1964,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":472,"mirror_url":null,"archived":false,"open_issues_count":127,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":472,"open_issues":127,"watchers":1964,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akveo/nebular/pulls/649"},"html":{"href":"https://github.com/akveo/nebular/pull/649"},"issue":{"href":"https://api.github.com/repos/akveo/nebular/issues/649"},"comments":{"href":"https://api.github.com/repos/akveo/nebular/issues/649/comments"},"review_comments":{"href":"https://api.github.com/repos/akveo/nebular/pulls/649/comments"},"review_comment":{"href":"https://api.github.com/repos/akveo/nebular/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akveo/nebular/pulls/649/commits"},"statuses":{"href":"https://api.github.com/repos/akveo/nebular/statuses/0e23673b8b4d7e0dbc123c3139627b3e0f601841"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cloakedch"}}