{"action":"created","issue":{"url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/issues/262","repository_url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter","labels_url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/issues/262/labels{/name}","comments_url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/issues/262/comments","events_url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/issues/262/events","html_url":"https://github.com/jadjoubran/laravel5-angular-material-starter/issues/262","id":149007570,"number":262,"title":"How to invoke this.$auth.setToken() if the call is not triggered from Angularjs","user":{"login":"AndrewLaBabies","id":8588393,"avatar_url":"https://avatars.githubusercontent.com/u/8588393?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewLaBabies","html_url":"https://github.com/AndrewLaBabies","followers_url":"https://api.github.com/users/AndrewLaBabies/followers","following_url":"https://api.github.com/users/AndrewLaBabies/following{/other_user}","gists_url":"https://api.github.com/users/AndrewLaBabies/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewLaBabies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewLaBabies/subscriptions","organizations_url":"https://api.github.com/users/AndrewLaBabies/orgs","repos_url":"https://api.github.com/users/AndrewLaBabies/repos","events_url":"https://api.github.com/users/AndrewLaBabies/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewLaBabies/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/labels/Support","name":"Support","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-04-17T23:54:46Z","updated_at":"2016-04-21T19:53:20Z","closed_at":"2016-04-20T15:53:13Z","body":"Hi Everyone,\r\n\r\nI got a case:\r\n1. An application finished the authentication, and then send the openID to my Laravel application.\r\n2. Laravel application using that openID to generate the token, and then send to index.blade.php\r\n3. index.blade.php can get the token.\r\n\r\nHowever, how could I set the token into Angularjs? like this.$auth.setToken(response.data.token) in login-form.component.js.\r\n\r\nI spend quite a lot of time to try to resolve, but still failed…\r\nPlease help, thanks in advance.\r\n\r\nBest Regards,\r\nAndrew He\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/issues/comments/213088976","html_url":"https://github.com/jadjoubran/laravel5-angular-material-starter/issues/262#issuecomment-213088976","issue_url":"https://api.github.com/repos/jadjoubran/laravel5-angular-material-starter/issues/262","id":213088976,"user":{"login":"jadjoubran","id":2265232,"avatar_url":"https://avatars.githubusercontent.com/u/2265232?v=3","gravatar_id":"","url":"https://api.github.com/users/jadjoubran","html_url":"https://github.com/jadjoubran","followers_url":"https://api.github.com/users/jadjoubran/followers","following_url":"https://api.github.com/users/jadjoubran/following{/other_user}","gists_url":"https://api.github.com/users/jadjoubran/gists{/gist_id}","starred_url":"https://api.github.com/users/jadjoubran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadjoubran/subscriptions","organizations_url":"https://api.github.com/users/jadjoubran/orgs","repos_url":"https://api.github.com/users/jadjoubran/repos","events_url":"https://api.github.com/users/jadjoubran/events{/privacy}","received_events_url":"https://api.github.com/users/jadjoubran/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T19:53:20Z","updated_at":"2016-04-21T19:53:20Z","body":"Can you post some js code?\r\ncode for setting token\r\nthen add a console.log for ($localStorage)\r\nand then the API call for the restricted endpoint"}}