diff --git a/changes/changelog.d/245.bugfix b/changes/changelog.d/245.bugfix new file mode 100644 index 0000000000000000000000000000000000000000..9552797317b0fa6a7fda21ecb5e99e5670ce0fa2 --- /dev/null +++ b/changes/changelog.d/245.bugfix @@ -0,0 +1 @@ +Fixed admin menu not showing after login (#245) diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index 72c55847fa3ed09c1cd428cba0347495f3608903..d46fb846cf1d76fd23265b18f1fd34a6e361dfe7 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -272,7 +272,7 @@ export default { this.scrollToCurrent() } }, - '$store.state.availablePermissions': { + '$store.state.auth.availablePermissions': { handler () { this.fetchNotificationsCount() }, diff --git a/front/src/components/auth/Login.vue b/front/src/components/auth/Login.vue index f3add57b1cccd736c82eb4f749764a9c0229ab2f..8286860bcaa051fdf2ee844dc878805c3402dcfd 100644 --- a/front/src/components/auth/Login.vue +++ b/front/src/components/auth/Login.vue @@ -79,8 +79,6 @@ export default { username: this.credentials.username, password: this.credentials.password } - // We need to pass the component's this context - // to properly make use of http in the auth service this.$store.dispatch('auth/login', { credentials, next: '/library', diff --git a/front/src/store/auth.js b/front/src/store/auth.js index 87af081d26fdfd09d2d02b16db6196f91d6cee95..d36366996c5ea49b546e1c7394d00f00bd28858e 100644 --- a/front/src/store/auth.js +++ b/front/src/store/auth.js @@ -25,7 +25,11 @@ export default { state.username = '' state.token = '' state.tokenData = {} - state.availablePermissions = {} + state.availablePermissions = { + federation: false, + library: false, + upload: false + } }, profile: (state, value) => { state.profile = value @@ -108,8 +112,8 @@ export default { commit('authenticated', true) commit('profile', data) commit('username', data.username) - dispatch('favorites/fetch', null, {root: true}) - dispatch('playlists/fetchOwn', null, {root: true}) + dispatch('favorites/fetch', null, { root: true }) + dispatch('playlists/fetchOwn', null, { root: true }) Object.keys(data.permissions).forEach(function (key) { // this makes it easier to check for permissions in templates commit('permission', {key, status: data.permissions[String(key)]})