mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-15 08:12:25 +02:00
Refactor routes rejection using middlewares
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user