1
I am following a course of Laravel 5.5 + Vuejs, and putting into practice what is being taught. However, it doesn’t address authentication at the moment, and as I’m structuring the whole project to load its content with Vuejs, it’s getting a little 'sad' the page refresh in the login system.
So, temporarily, I did a little function in the beforeCreate method to send a request. However, in this way, all requests made by the user, make 2 requests: One to know if it is connected and the other from the user himself. I’ve been thinking about the best way to solve this, so I saw the possibility of inserting a definitive field in all the request responses with a boolean indicating whether or not it’s authenticated. But just like the first, I believe I’m a beautiful POG.
So I ask, how to verify if the user is authenticated in Vuejs?