removed sso related code from client/store/index.js and renamed some functions in client/store/sso.js

This commit is contained in:
David Leimroth 2022-02-07 17:05:12 +01:00
parent 27f498ffae
commit 53e6c9f913
2 changed files with 2 additions and 31 deletions

View File

@ -32,10 +32,6 @@ export const getters = {
if (!state.serverSettings) return null
return state.serverSettings[key]
},
getSSOSetting: state => key => {
if (!state.SSOSettings) return null
return state.getSSOSettings[key]
},
getBookCoverAspectRatio: state => {
if (!state.serverSettings || !state.serverSettings.coverAspectRatio) return 1.6
return state.serverSettings.coverAspectRatio === 0 ? 1.6 : 1
@ -63,22 +59,6 @@ export const actions = {
return false
})
},
updateSSOSettings({ commit }, payload) {
var updatePayload = {
...payload
}
return this.$axios.$patch('/api/SSOSettings', updatePayload).then((result) => {
if (result.success) {
commit('setSSOSettings', result.SSOSettings)
return true
} else {
return false
}
}).catch((error) => {
console.error('Failed to update server settings', error)
return false
})
},
checkForUpdate({ commit }) {
return checkForUpdate()
.then((res) => {
@ -126,10 +106,6 @@ export const mutations = {
if (!settings) return
state.serverSettings = settings
},
setSSOSettings(state, settings) {
if (!settings) return
state.SSOSettings = settings
},
setStreamAudiobook(state, audiobook) {
state.playOnLoad = true
state.streamAudiobook = audiobook

View File

@ -58,13 +58,13 @@ export const getters = {
}
export const actions = {
updateUserSettings({ commit }, payload) {
updateSSOSettings({ commit }, payload) {
var updatePayload = {
...payload
}
// Immediately update
commit('setSSOSettings', updatePayload)
return this.$axios.$patch('/api/sso/settings', updatePayload).then((result) => {
return this.$axios.$patch('/api/SSOSettings', updatePayload).then((result) => {
if (result.success) {
commit('setSSOSettings', result.settings)
return true
@ -77,11 +77,6 @@ export const actions = {
})
},
loadSSOSettings({ state, commit }) {
return defaultSSOSettings
if (state.collectionsLoaded) {
console.log('Collections already loaded')
return state.collections
}
return this.$axios.$get('/api/collections').then((collections) => {
commit('setCollections', collections)