Commit 8e702a4a authored by anton's avatar anton

Get access_token from $auth plugin instead of localStorage

parent f433e108
Pipeline #50209 passed with stage
in 5 minutes and 31 seconds
......@@ -80,9 +80,9 @@
if (this.data.grid.stylesheet.id) {
let stylesheetURL = this.data.grid.stylesheet.id
if (stylesheetURL.indexOf(process.env.STORAGE_HOST) === 0) {
if (localStorage.getItem('access_token')) {
if (this.$auth && this.$auth.token) {
stylesheetURL += stylesheetURL.indexOf('?') > -1 ? '&' : '?'
stylesheetURL += `token=${localStorage.getItem('access_token')}`
stylesheetURL += `token=${this.$auth.token}`
}
}
this.stylesheetUrl = stylesheetURL
......
......@@ -37,9 +37,9 @@
imgSrc () {
let src = this.cell.source._value.content
if (process.env.STORAGE_HOST && src.indexOf(process.env.STORAGE_HOST) === 0) {
if (this.user && localStorage.getItem('access_token')) {
if (this.user && this.$auth.token) {
src += src.indexOf('?') === -1 ? '?' : '&'
src += `token=${encodeURIComponent(localStorage.getItem('access_token'))}`
src += `token=${encodeURIComponent(this.$auth.token)}`
}
}
return src
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment