Refactor routes rejection using middlewares

This commit is contained in:
Bubka
2022-03-29 15:02:43 +02:00
parent 30331998d2
commit 5eee3de134
21 changed files with 67 additions and 225 deletions

View File

@ -101,11 +101,19 @@
this.isFetching = true
await this.axios.get('/webauthn/credentials').then(response => {
if (response.status === 202) {
await this.axios.get('/webauthn/credentials', {returnError: true})
.then(response => {
this.credentials = response.data
})
.catch(error => {
if( error.response.status === 400 ) {
this.isRemoteUser = true
}
else this.credentials = response.data
else {
this.$router.push({ name: 'genericError', params: { err: error.response } });
}
})
this.isFetching = false