Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Rian Ariona ariona

🏠
Working from home
View GitHub Profile
View nuxt-auth-redirect.js
//plugins/axios.js
export default function ({ $axios, app }) {
$axios.onError(error => {
const code = parseInt(error.response && error.response.status)
if ([401, 403].includes(code)) {
app.$auth.logout();
}