{"action":"created","issue":{"url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/issues/256","repository_url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder","labels_url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/issues/256/labels{/name}","comments_url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/issues/256/comments","events_url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/issues/256/events","html_url":"https://github.com/mean-expert-official/loopback-sdk-builder/issues/256","id":195556302,"number":256,"title":"Question: How to get logged in user information","user":{"login":"PhilippeCorreges","id":11230777,"avatar_url":"https://avatars.githubusercontent.com/u/11230777?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilippeCorreges","html_url":"https://github.com/PhilippeCorreges","followers_url":"https://api.github.com/users/PhilippeCorreges/followers","following_url":"https://api.github.com/users/PhilippeCorreges/following{/other_user}","gists_url":"https://api.github.com/users/PhilippeCorreges/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilippeCorreges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilippeCorreges/subscriptions","organizations_url":"https://api.github.com/users/PhilippeCorreges/orgs","repos_url":"https://api.github.com/users/PhilippeCorreges/repos","events_url":"https://api.github.com/users/PhilippeCorreges/events{/privacy}","received_events_url":"https://api.github.com/users/PhilippeCorreges/received_events","type":"User","site_admin":false},"labels":[{"id":389691099,"url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":{"login":"jonathan-casarrubias","id":1533239,"avatar_url":"https://avatars.githubusercontent.com/u/1533239?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathan-casarrubias","html_url":"https://github.com/jonathan-casarrubias","followers_url":"https://api.github.com/users/jonathan-casarrubias/followers","following_url":"https://api.github.com/users/jonathan-casarrubias/following{/other_user}","gists_url":"https://api.github.com/users/jonathan-casarrubias/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathan-casarrubias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathan-casarrubias/subscriptions","organizations_url":"https://api.github.com/users/jonathan-casarrubias/orgs","repos_url":"https://api.github.com/users/jonathan-casarrubias/repos","events_url":"https://api.github.com/users/jonathan-casarrubias/events{/privacy}","received_events_url":"https://api.github.com/users/jonathan-casarrubias/received_events","type":"User","site_admin":false},"assignees":[{"login":"jonathan-casarrubias","id":1533239,"avatar_url":"https://avatars.githubusercontent.com/u/1533239?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathan-casarrubias","html_url":"https://github.com/jonathan-casarrubias","followers_url":"https://api.github.com/users/jonathan-casarrubias/followers","following_url":"https://api.github.com/users/jonathan-casarrubias/following{/other_user}","gists_url":"https://api.github.com/users/jonathan-casarrubias/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathan-casarrubias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathan-casarrubias/subscriptions","organizations_url":"https://api.github.com/users/jonathan-casarrubias/orgs","repos_url":"https://api.github.com/users/jonathan-casarrubias/repos","events_url":"https://api.github.com/users/jonathan-casarrubias/events{/privacy}","received_events_url":"https://api.github.com/users/jonathan-casarrubias/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-12-14T15:10:46Z","updated_at":"2016-12-16T17:29:59Z","closed_at":null,"body":"#### What type of issue are you creating?\r\n- [ ] Bug\r\n- [ ] Enhancement\r\n- [X] Question\r\n\r\n#### What version of this module are you using?\r\n- [X] 2.0.10 (Stable)\r\n- [ ] 2.1.0-rc.n (2.1 Release Candidate n)\r\n- [ ] Other\r\n\r\nWrite other if any:\r\n\r\n#### Please add a description for your issue:\r\n\r\nHello,\r\nI have the following login component: \r\n`import { Component, OnInit } from '@angular/core';\r\nimport { Client, AccessToken } from '../shared/sdk/models';\r\nimport { ClientApi } from '../shared/sdk/services';\r\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n  selector: 'login',\r\n  templateUrl: './login.component.html',\r\n  styleUrls: ['./login.component.css']\r\n})\r\nexport class LoginComponent implements OnInit {\r\n\r\n  private user: Client = new Client();\r\n\r\n  constructor(\r\n      private clientApi: ClientApi,\r\n      private router: Router\r\n  ) { }\r\n\r\n  ngOnInit() { }\r\n\r\n  login() {\r\n    this.clientApi.login(this.user).subscribe(\r\n        (token: AccessToken) => this.router.navigate(['/home']),\r\n        err => alert(err.message)\r\n    );\r\n  }\r\n\r\n}`\r\n\r\nI am wondering how I can get access to the user(Client?) object in my whole app.\r\n\r\nKing regards,"},"comment":{"url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/issues/comments/267648864","html_url":"https://github.com/mean-expert-official/loopback-sdk-builder/issues/256#issuecomment-267648864","issue_url":"https://api.github.com/repos/mean-expert-official/loopback-sdk-builder/issues/256","id":267648864,"user":{"login":"PhilippeCorreges","id":11230777,"avatar_url":"https://avatars.githubusercontent.com/u/11230777?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilippeCorreges","html_url":"https://github.com/PhilippeCorreges","followers_url":"https://api.github.com/users/PhilippeCorreges/followers","following_url":"https://api.github.com/users/PhilippeCorreges/following{/other_user}","gists_url":"https://api.github.com/users/PhilippeCorreges/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilippeCorreges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilippeCorreges/subscriptions","organizations_url":"https://api.github.com/users/PhilippeCorreges/orgs","repos_url":"https://api.github.com/users/PhilippeCorreges/repos","events_url":"https://api.github.com/users/PhilippeCorreges/events{/privacy}","received_events_url":"https://api.github.com/users/PhilippeCorreges/received_events","type":"User","site_admin":false},"created_at":"2016-12-16T17:29:59Z","updated_at":"2016-12-16T17:29:59Z","body":"Hi @jonathan-casarrubias \r\nI would like to manage \"menus\" anfd show them only if user is authenticated.\r\nI have seen there is a service called auth.service.ts.\r\nShould I used it injecting it at the top level module to be able to know if a user is authenticated ?\r\n\r\nMany thanks for you advice on that topic.\r\n\r\n"}}
{"actor":{"display_login":"PhilippeCorreges"}}