Skip to content

Commit 1ffa229

Browse files
committed
log(Plugin): axios
1 parent a4a2342 commit 1ffa229

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/axios.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ const axios: Plugin = ({$axios, redirect, $auth, route}) => {
1616
return response
1717
},
1818
async (error) => {
19+
console.log(route.path);
20+
1921
if (error.response.status === 401 && route.path !== '/login') {
2022
if($auth.loggedIn) {
23+
console.log('logged');
2124
await $auth.logout();
2225
}
2326

27+
console.log('redirect');
28+
2429
redirect(401, "/login");
2530
} else {
31+
console.log('return error');
2632
return Promise.reject(error);
2733
}
2834
});

0 commit comments

Comments
 (0)