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

  1. 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.

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

  3. 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.

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

  5. 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.

  6. 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!

  7. 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!

  8. 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!

  9. 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?

Leave a Reply

Your email address will not be published.