jamesdordoy / laravel-vue-datatable

Vue.js Datatable made for Laravel
https://jamesdordoy.github.io/laravel-vue-datatable
MIT License
151 stars 52 forks source link

Auth error #118

Closed keuteixeira closed 2 years ago

keuteixeira commented 3 years ago

Hello, all my requests I handle in my axios updating the refreshToken that comes from Middleware, the question is that I can't intercept the requests of the plugin in axios so that I can update the Store token.

Besides that when the token expires and the user accesses any screen I can intercept in Route's middleware and notify that the session has expired, already on the screen where there is Datatable I receive a 401 Unauthorized alert, without being able to handle the error.

EspetoRx commented 3 years ago

Yeah, I'm facing the same problem. I would like to Handle the authentication Error, to redirect to Login.

keuteixeira commented 3 years ago

I had to edit the file in the node_modules folder, placing the redirect when the status code is 402, if I'm not mistaken that is the authentication one.

EspetoRx commented 3 years ago

The most common of mine are the 401 and the 419 errors. I'll do that. Thanks.