Mauro Casas
Mauro Casas

Reputation: 2475

Detect Authorized response after AJAX call

I have an API which I consume from a VueJS app, backend is handled through Laravel 5.2.

I have setup automatic session timeout after 15min, but if happens you're in the site and try to do anything, I have a loading screen, and it freezes as you're unauthorized.

I wanted to know if there's any global method to read Unauthorized response when all requests are made.

I don't know what this is called, so I wouldn't know how to properly Google the feature.

I'm using VueJS Resource $http library to manage all requests.

Thanks!

Upvotes: 1

Views: 283

Answers (1)

Mauro Casas
Mauro Casas

Reputation: 2475

I've finally made my way to the right documentation, it was under Vue-Resource, and these are called Interceptors.

https://github.com/vuejs/vue-resource/blob/master/docs/http.md

Upvotes: 1

Related Questions