Fix logout
This commit is contained in:
parent
a44bd3b050
commit
05b665087a
@ -1,8 +1,5 @@
|
||||
import * as Forge from 'node-forge'
|
||||
import axios from 'axios'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
export default {
|
||||
_user: null,
|
||||
@ -72,7 +69,6 @@ export default {
|
||||
window.localStorage.removeItem('refresh_token');
|
||||
await axios.post('authentication/logout')
|
||||
axios.defaults.headers['authorization'] = null;
|
||||
router.push({ name: 'login-form' })
|
||||
},
|
||||
|
||||
async getUser() {
|
||||
|
@ -41,7 +41,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</dx-item>
|
||||
|
||||
|
||||
<template #menuUserItem>
|
||||
<user-panel
|
||||
:email="email"
|
||||
@ -75,7 +75,7 @@ export default {
|
||||
|
||||
const email = ref("");
|
||||
auth.getUser().then((e) => email.value = e.data.email);
|
||||
|
||||
|
||||
const userMenuItems = [{
|
||||
text: "Profile",
|
||||
icon: "user",
|
||||
@ -86,13 +86,10 @@ export default {
|
||||
icon: "runner",
|
||||
onClick: onLogoutClick
|
||||
}];
|
||||
|
||||
function onLogoutClick() {
|
||||
auth.logOut();
|
||||
router.push({
|
||||
path: "/login-form",
|
||||
query: { redirect: route.path }
|
||||
});
|
||||
|
||||
async function onLogoutClick() {
|
||||
await auth.logOut();
|
||||
router.push({name: 'login-form'});
|
||||
}
|
||||
|
||||
function onProfileClick() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user