loading...

Discussion on: PKCE authenticaton for Nuxt SPA with Laravel as backend

Collapse
thorbn profile image
Thor

Sorry to disturb again.

I'm still having problems with, how to get the users info (like name) to show on page (like in the footer). If reloading the webapp I still have the access token but the name I set with this.$auth.setUser(resp.name) is gone. Do you have and example on how to get the webapp to save the user name on reload? I can do it with a cookie, but think that its not safe.

Collapse
stefant123 profile image
StefanT123 Author

You can use the cookies to persist the state or use some package that does that. Don't worry about security, because the user name is not something that should not be publicly visible.

Collapse
thorbn profile image
Thor

Can other users not just change the userId in the local cookie to something else and then get other users info from the api? In my case todos

Thread Thread
stefant123 profile image
StefanT123 Author

Well, if you've set up your back-end properly, they won't be able to do that