- Complete GGZ Ecademy Nuxt.js user portal - Learning products browser and management - Member management interface - User authentication and roles - Multi-language support (NL/EN) - Vuex store for state management - Component-based architecture
This commit is contained in:
11
plugins/axios.js
Normal file
11
plugins/axios.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export default function ({ $axios, app }) {
|
||||
$axios.onError(error => {
|
||||
const code = parseInt(error.response && error.response.status)
|
||||
|
||||
if ([401, 403].includes(code)) {
|
||||
app.$auth.logout();
|
||||
}
|
||||
|
||||
return Promise.reject(error);
|
||||
})
|
||||
};
|
||||
Reference in New Issue
Block a user