Move the API token getter to the globals mixin.
This commit is contained in:
parent
aa9204fcfe
commit
6717e00647
2 changed files with 8 additions and 2 deletions
|
|
@ -16,11 +16,17 @@ Vue.mixin({
|
|||
api_url: `https://api.spotify.com/v1`,
|
||||
auth_redirect: process.env.NODE_ENV === `production` ? `https://oliver.akins.me/top-lists` : `http://localhost:8080`,
|
||||
}},
|
||||
computed: {
|
||||
api_token() {
|
||||
let params = new URLSearchParams(window.location.hash.slice(1));
|
||||
return params.get(`access_token`);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
css_var(var_name) {
|
||||
return getComputedStyle(document.documentElement).getPropertyValue(var_name);
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue