mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-23 10:44:59 +01:00
Better throttle, attempt to have proper UX
This commit is contained in:
@@ -3,6 +3,7 @@ import Cookies from 'js-cookie'
|
||||
|
||||
import router from '../router'
|
||||
import store from '../store'
|
||||
import app from '../App.vue'
|
||||
|
||||
const _axios = axios.create()
|
||||
|
||||
@@ -31,6 +32,10 @@ _axios.interceptors.response.use(
|
||||
router.push({ name: 'TwoFA' })
|
||||
return Promise.reject(error)
|
||||
}
|
||||
if (error.response.status === 429) {
|
||||
app.showNotification()
|
||||
return Promise.reject(error)
|
||||
}
|
||||
if (error.response.status !== 401 || router.currentRoute.path === '/login/') {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user