Forward Auth refactor and adding PROXY_FORWARD_AUTH_LOGOUT_URI env

This commit is contained in:
advplyr 2022-12-18 11:37:45 -06:00
parent 8558baf30a
commit 73a61872fa
9 changed files with 139 additions and 68 deletions

View file

@ -75,9 +75,8 @@ export default {
this.$setLanguageCode(lang)
},
logout() {
var rootSocket = this.$root.socket || {}
const logoutPayload = {
socketId: rootSocket.id
socketId: (this.$root.socket || {}).id
}
this.$axios.$post('/logout', logoutPayload).catch((error) => {
console.error(error)
@ -87,7 +86,13 @@ export default {
}
this.$store.commit('libraries/setUserPlaylists', [])
this.$store.commit('libraries/setCollections', [])
this.$router.push('/login')
if (this.$store.getters['user/getForwardAuthLogoutURI']) {
// Redirect to forward auth logout uri
location.replace(this.$store.getters['user/getForwardAuthLogoutURI'])
} else {
this.$router.push('/login')
}
},
resetForm() {
this.password = null