Skip to content
Snippets Groups Projects
Commit 25fbebf3 authored by nicrausaz's avatar nicrausaz
Browse files

Fix date de connexion

parent 22b3d45f
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ import MainFooter from '@/layouts/MainFooter.vue' ...@@ -19,7 +19,7 @@ import MainFooter from '@/layouts/MainFooter.vue'
import alertSnackbar from '@/components/alertSnackbar.vue' import alertSnackbar from '@/components/alertSnackbar.vue'
export default { export default {
created() { created () {
let key = null let key = null
if (location.hash !== '#/') { if (location.hash !== '#/') {
key = location.hash.replace('#/?key=', '') key = location.hash.replace('#/?key=', '')
...@@ -29,6 +29,8 @@ export default { ...@@ -29,6 +29,8 @@ export default {
} }
if (!this.$store.getters['moduleUser/userIsLogedIn']) { if (!this.$store.getters['moduleUser/userIsLogedIn']) {
this.$store.dispatch('moduleUser/login', key) this.$store.dispatch('moduleUser/login', key)
} else {
this.$store.dispatch('moduleUser/getLastConnection')
} }
}, },
components: { components: {
......
...@@ -15,20 +15,12 @@ export function login (context, key) { ...@@ -15,20 +15,12 @@ export function login (context, key) {
export function logout (context, fullLogout) { export function logout (context, fullLogout) {
localStorage.removeItem('stored_token') localStorage.removeItem('stored_token')
if (fullLogout) { if (fullLogout) {
// set last conn ? setLastConnection().then(() => {
window.location = 'https://tequila.epfl.ch/logout' window.location = 'https://tequila.epfl.ch/logout'
})
} else { } else {
location.reload() location.reload()
} }
// setLastConnection().then(() => {
// console.log('test')
// localStorage.removeItem('stored_token')
// if (fullLogout) {
// window.location = 'https://tequila.epfl.ch/logout'
// } else {
// location.reload()
// }
// })
} }
export function getUserData (context) { export function getUserData (context) {
......
export function setUserData(state, data) { export function setUserData (state, data) {
state.userData = data state.userData = data
} }
export function setPermittedJobs(state, data) { export function setPermittedJobs (state, data) {
state.permittedJobs = data state.permittedJobs = data
} }
export function setLastConnection(state, data) { export function setLastConnection (state, data) {
state.lastConnection = data state.lastConnection = data
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment