{"action":"created","issue":{"url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth/issues/50","repository_url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth","labels_url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth/issues/50/comments","events_url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth/issues/50/events","html_url":"https://github.com/ronzeidman/ng2-ui-auth/issues/50","id":182020303,"number":50,"title":"tokenRoot setting","user":{"login":"simkepal","id":1116275,"avatar_url":"https://avatars.githubusercontent.com/u/1116275?v=3","gravatar_id":"","url":"https://api.github.com/users/simkepal","html_url":"https://github.com/simkepal","followers_url":"https://api.github.com/users/simkepal/followers","following_url":"https://api.github.com/users/simkepal/following{/other_user}","gists_url":"https://api.github.com/users/simkepal/gists{/gist_id}","starred_url":"https://api.github.com/users/simkepal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simkepal/subscriptions","organizations_url":"https://api.github.com/users/simkepal/orgs","repos_url":"https://api.github.com/users/simkepal/repos","events_url":"https://api.github.com/users/simkepal/events{/privacy}","received_events_url":"https://api.github.com/users/simkepal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-10T13:52:49Z","updated_at":"2016-10-11T06:51:09Z","closed_at":null,"body":"Hello!\r\n\r\nGreat job with this. But I found a problem. My server always returns....\r\n`{\r\n     \"error\":false,\r\n     \"message\":\"signin-ok\",\r\n     \"data\":{\r\n          \"token\":\"*******\"\r\n     },\r\n     \"statusCode\":200\r\n}`\r\n\r\nI also set tokenRoot in config to data (tokenRoot = 'data';)\r\n\r\nI Always get on error, because token is not set in root response.\r\nI think you should improve a line in setToken function to something like this:\r\n`var accessToken = response && response.json() && (response.json().access_token || response.json().token || response.json()[this.config.tokenRoot].token);`\r\n\r\nThank you!\r\n"},"comment":{"url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth/issues/comments/252828122","html_url":"https://github.com/ronzeidman/ng2-ui-auth/issues/50#issuecomment-252828122","issue_url":"https://api.github.com/repos/ronzeidman/ng2-ui-auth/issues/50","id":252828122,"user":{"login":"simkepal","id":1116275,"avatar_url":"https://avatars.githubusercontent.com/u/1116275?v=3","gravatar_id":"","url":"https://api.github.com/users/simkepal","html_url":"https://github.com/simkepal","followers_url":"https://api.github.com/users/simkepal/followers","following_url":"https://api.github.com/users/simkepal/following{/other_user}","gists_url":"https://api.github.com/users/simkepal/gists{/gist_id}","starred_url":"https://api.github.com/users/simkepal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simkepal/subscriptions","organizations_url":"https://api.github.com/users/simkepal/orgs","repos_url":"https://api.github.com/users/simkepal/repos","events_url":"https://api.github.com/users/simkepal/events{/privacy}","received_events_url":"https://api.github.com/users/simkepal/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T06:51:09Z","updated_at":"2016-10-11T06:51:09Z","body":"Hello,\r\n\r\nI just tested this out. If I create a function in my config it is working OK. \r\nBut now everyone with server response like mine or similar has to create this function and tokenRoot in config does not mean anything. Or am I wrong?\r\n\r\nThank you for your quick fix!!!!"}}
{"actor":{"display_login":"simkepal"}}