Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

DarkRoast's avatar

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.

0 likes
2 replies
knubbe's avatar

localStorage in combination with Vuex is fine for this scenario

3 likes

Please or to participate in this conversation.