Commit a6c1e21d authored by Jean Rabreau's avatar Jean Rabreau
Browse files

馃悰internals profile update patched

parent 22b427fb
......@@ -119,9 +119,7 @@ export default {
},
methods: {
onLogOut() {
this.$store.dispatch('contrib/logOut').then(() => {
this.$router.push({name: 'logout'})
})
this.$store.dispatch('contrib/logOut')
},
},
}
......
......@@ -45,6 +45,7 @@
<script>
import {mapActions} from 'vuex'
import authority from '@/assets/authAxios'
export default {
name: "ProfileFormInternalRefresh",
......@@ -54,9 +55,17 @@ export default {
}
},
methods: {
...mapActions('contrib', ['refreshProfile']),
...mapActions('contrib', ['logOut']),
...mapActions('dialog', ['displayError']),
onRefresh() {
this.refreshProfile()
authority.patch('/users/profile/ldap-refresh/')
.then(() => {this.logOut(this.$route.fullPath)})
.catch(error => {
this.displayError({
message: this.$t('profile.update.wanted.failed'),
error: error
})
})
},
}
}
......
......@@ -535,6 +535,8 @@ export const en_US = {
failure: "Your profile has not been updated",
wanted: {
button: "Update my profile",
deco: "You will be disconnected",
failed: "Your request aborted",
next: "My profile will be updated on next connexion"
}
},
......
......@@ -550,6 +550,7 @@ export const fr_FR = {
wanted: {
button: "Mettre 脿 jour",
deco: "Vous allez 锚tre d茅connect茅",
failed: "Votre demande n'a pas pu aboutir",
next: "Vos informations seront mises 脿 jour 脿 la prochaine connexion, cette op茅ration n茅cessite de se reconnecter."
}
},
......
......@@ -241,21 +241,11 @@ const Contrib = {
dispatch('dialog/displayError', {message, error}, {root: true})
})
},
logOut({commit}){
logOut({commit}, path = ''){
authority.logOut()
commit('LOGIN', false)
},
refreshProfile({dispatch}) {
dispatch('updateProfile', {
settings: {
...this.settings,
refreshInfo: true
}
}).then(succeed => {
if (succeed) {
dispatch('logOut').then(() => document.location.reload())
}
})
const logoutUrl = `${process.env.VUE_APP_AXIOS_BASE_URL}logout?redirect=${appOrigin}${path}`
window.location = logoutUrl
},
/**
*
......
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