Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default {
- name: 'app',
- components: {
- Hello
- },
- created () {
- const postData = {
- grant_type: 'password',
- client_id: 2,
- client_secret: 'somesecret',
- username: 'my@mail.com',
- password: 'password',
- scope: ''
- }
- this.$http.post('http://localhost:8000/oauth/token', postData)
- .then(response => {
- console.log(response)
- const header = {
- 'Accept': 'application/json',
- 'Authorization': 'Bearer ' + response.body.access_token
- }
- this.$http.get('http://localhost:8000/api/test', {headers: header})
- .then(response => {
- console.log(response)
- })
- })
- }
- }
- Uncaught (in promise) TypeError: Cannot read property 'access_token'
- of undefined at eval (eval at <anonymous> (app.js:810), <anonymous>:33:51)
- (anonymous) @ App.vue?86c0:29
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement