add: guard in router
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
|
||||
localStorage.setItem('id', result.data._id);
|
||||
localStorage.setItem('session', auth.sesion);
|
||||
// localStorage.setItem('access', auth.token);
|
||||
localStorage.setItem('access', auth.accessToken);
|
||||
|
||||
const userData = {
|
||||
"first_name" : user.name,
|
||||
@@ -109,6 +109,7 @@
|
||||
let respUser = await updateMyUserProfile( userData );
|
||||
if(respUser.msg === 'success') {
|
||||
auth.user = respUser.data;
|
||||
auth.isAuthenticated = true;
|
||||
} else {
|
||||
auth.user = userData;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
sesion: resp.data.session_token,
|
||||
token: resp.data.accessToken,
|
||||
user: resp.data.user,
|
||||
isAuthenticated: true
|
||||
})
|
||||
} else { // Completar registro
|
||||
auth.$patch({
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
})
|
||||
|
||||
const getInitialData = async() => {
|
||||
await auth.authenticationPromise;
|
||||
await company.getCompanyData();
|
||||
}
|
||||
|
||||
|
||||
13
src/views/NotFoundView.vue
Normal file
13
src/views/NotFoundView.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>No encontrada</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user