Courses
Vue Foundations Vue Fullstack Vue Enterprise
Articles
Latest Topics
More
Newsletter Sponsorship Discord About
The video for this lesson is currently being updated, please read the transcript instead.
Vue Fullstack > Lesson 37

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

Courses
  • Vue Foundations
  • Vue Fullstack
  • Vue Enterprise
Articles
  • Latest
  • Topics
Newsletter
  • Join
  • Sponsorship
More
  • Discord
  • Vue.js jobs
  • About

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

  • RSS
  • |
  • Atom