32 thoughts to “Vue 3 Authentication with JWT, Vuex, Axios and Vue Router”

  1. Thank you very much for this example!
    I have a doubt, to see if you can clarify me.

    If I want to do a validation only with username, without password. how do you do it?

  2. On the login page, when you call handleLogin(user) ….

    where does the user parameter come from??, could you make an example of AUTH with VUE3+CompositionAPI + TS???

    There is NOTHING about this on the internet right now!

  3. Thanks for the great tutorial!

    Is JWT necessary over HTTPS communication?
    I tried to run the communication to node express over HTTPS –
    but can’t get it to work.
    net::ERR_CONNECTION_TIMED_OUT

    Does Node Express need something like:
    *************** http://expressjs.com/en/api.html#app.listen
    var express = require(‘express’)
    var https = require(‘https’)
    var http = require(‘http’)
    var app = express()

    http.createServer(app).listen(80)
    https.createServer(options, app).listen(443)
    ***************
    to connect with HTTPS?

    Thx!

  4. On the login page, when you call handleLogin(user) ….

    where does the user parameter come from??, could you make an example of AUTH with VUE3+CompositionAPI + TS???

    There is NOTHING about this on the internet right now!

  5. WOW! just what I was searching for. Came here by searching for a lot tutorials and yours is the best!

  6. I really like studying your tutorial.
    Keep up the good work! You know, a lot of individuals are looking around for this Vue 3 tutorial, you could help them greatly.

  7. Your way of describing all in this tutorial is genuinely good, all be able to without difficulty understand it, Thanks a lot.

  8. Thank you very much for this great tutorial!
    Very clear and well described, However I have one concern, do you think that importing UserService directly into Home.vue component is the best practice?

    Wouldn’t it be better if we let Vuex to interact with the UserService as we did for the AuthService?

    I mean creating a user.js module in store same we as we create auth.js and then from Home.vue (or any other component) to dispatch to the actions in user.js module.

    1. Hi, UserService (in this tutorial, just like a data service) is an example which indicates that we don’t need to put everything in the store 🙂
      Generally we use Vuex store when we need the same data at two completely different places in our application. This is the point Vuex makes a lot of sense.

  9. Brief but very accurate tutorial. Many thanks for sharing this one!
    A must read post!

  10. Awesome Vue3 tutorial. Extremely comprehensive and easy to understand. Thanks!!!

  11. Many thanks for this excellent tutorial. Would be nice to see a similar example using the Vue 3 Composition API.

  12. This is very useful content thank you for sharing it with us. Also is there a tutorial about using refresh tokens in the Vue3 application. Also, using HTTP only cookies to store JWT.

Comments are closed to reduce spam. If you have any question, please send me an email.