Found this tutorial which uses the second method and avoids using localStorage so I think I'll use that: https://blog.codecourse.com/setting-up-laravel-sanctum-airlock-for-spa-authentication-with-vue/
Dec 7, 2021
2
Level 8
Sanctum SPA + roles where to store user info on front end?
Hello, I am using Laravel Sanctum SPA Authentication with a Vue.js app. I want to incorporate user roles with this but I am wondering where would be the best place to store this information on the front end? Would it be safe to store user information in localStorage (e.g. their name, username and current role) or should I use a different approach? One other method I considered involves loading the returned user account information into a Vuex store on page refresh or login.
Please or to participate in this conversation.