fix: issues ux
This commit is contained in:
@@ -5,6 +5,7 @@ import { renewToken } from '../services/auth';
|
||||
import {useNotificationsStore} from './notifications';
|
||||
import {useCompanyStore} from './company';
|
||||
import { useLoadsStore } from "./loads";
|
||||
import { useVehiclesStore } from "./vehicles";
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
@@ -12,6 +13,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const noty = useNotificationsStore();
|
||||
const company = useCompanyStore();
|
||||
const loadStore = useLoadsStore();
|
||||
const vehiclesStore = useVehiclesStore();
|
||||
const sesion = ref('')
|
||||
const checking = ref(false);
|
||||
const authStatus = ref('checking');
|
||||
@@ -54,16 +56,20 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
});
|
||||
|
||||
const logout = () => {
|
||||
console.log('logoo....');
|
||||
sesion.value = '';
|
||||
token.value = '';
|
||||
company.clear();
|
||||
localStorage.clear();
|
||||
user.value = null;
|
||||
console.log(company.company);
|
||||
localStorage.removeItem('access');
|
||||
localStorage.removeItem('id');
|
||||
localStorage.removeItem('session');
|
||||
|
||||
sesion.value = '';
|
||||
token.value = '';
|
||||
user.value = null;
|
||||
checking.value = false;
|
||||
authStatus.value = 'checking'
|
||||
|
||||
company.clear();
|
||||
loadStore.clear();
|
||||
vehiclesStore.clear();
|
||||
|
||||
router.push({name: 'login'});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user