mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 13:29:16 +02:00
Now use vuex to manage state for authentication
This commit is contained in:
parent
df94ae37bf
commit
b5ce65fc3e
14 changed files with 137 additions and 179 deletions
|
@ -15,7 +15,6 @@
|
|||
<script>
|
||||
import {mapState} from 'vuex'
|
||||
import backend from '@/audio/backend'
|
||||
import auth from '@/auth'
|
||||
import url from '@/utils/url'
|
||||
|
||||
// import logger from '@/logging'
|
||||
|
@ -40,12 +39,12 @@ export default {
|
|||
return null
|
||||
}
|
||||
let path = backend.absoluteUrl(file.path)
|
||||
if (auth.user.authenticated) {
|
||||
if (this.$store.state.auth.authenticated) {
|
||||
// we need to send the token directly in url
|
||||
// so authentication can be checked by the backend
|
||||
// because for audio files we cannot use the regular Authentication
|
||||
// header
|
||||
path = url.updateQueryString(path, 'jwt', auth.getAuthToken())
|
||||
path = url.updateQueryString(path, 'jwt', this.$store.state.auth.token)
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue