Summer Sale! All accounts are 50% off this week.

bashovski's avatar

Authentication via JWT or session with Vue.js

I was wondering what is the best way to authenticate user actions on the backend by sending HTTP requests via Axios. At the moment, I want to implement private messages in my little project and I am trying to find the best way to authenticate the user who is sending the message.

Thanks in advance.

0 likes
1 reply
tykus's avatar

That depends on how you are using Vue in you Laravel app. A pure SPA will need a token (e.g. JWT) to authenticate the user. For an application that uses a sprinkling of Vue in Blade templates, you can use the session and cookies.

Please or to participate in this conversation.