Articles
Latest
More
Newsletter Sponsorship Discord About
Sign up for our Newsletter
The video for this lesson is currently being updated, please read the transcript instead.
Enterprise Vue > Lesson 38

Generating a JWT

When users log in to PrintBay, we're going to generate a JSON Web Token and send it back to them.

This token will also be stored on the user model so that when the token is later used to authenticate a call, we can match the token to the user.

This means we need to enhance our User schema to store the token by adding a new property token and making it's type a String.

server/models/user.js

const UserSchema = mongoose.Schema({
  name: { ... },
  email: { ... },

Back to course page

Click to load comments...

Articles
  • Latest
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

Vue.js Developers © 2021. View our privacy policy .

  • RSS
  • |
  • Atom