Learn how to protect user accounts with encrypted passwords.
- [Instructor] In this video we're going to be using … the BCrypt library to encrypt our passwords in Nodejs. … So, first I want to do something that I forgot to do, … which is go into the, … Register Controller and we also need do, … make sure that we save the first and last name, … for the Users Schema. … So, go ahead and set that first and last name right there. … And then, in our validation, … we want to make sure we check for that as well. … And we actually don't need this toLowerCase method. … So, I'll just copy this validation, … and do the same thing for the first and the last name. … And so, you want to open a new terminal window, … and npm install bcrypt-nodejs. … So then, inside of our user model, … let's go ahead and import Bcrypt, … so, import Bcrypt from Bcrypt-Nodejs. … And so, down here in our pre-saved method, … that's where we'll encrypt the password. … So, I'm going to save the, … non-encrypted one, … to this variable called unsafePassword, … and then, I'll say, this.password, …
- Single-page applications and Vue.js
- Preparing your development environment
- Creating a Vue.js application
- Using the Vue.js router
- Building a RESTful back-end API with Node.js and Express.js
- Connecting to MongoDB
- Validating and managing a user session
- Connecting Vue.js to a back-end server
Skill Level Intermediate
1. Getting to Know the MEVN Stack
2. Preparing Your Development Environment
3. Vue.js Core Concepts
4. Building a RESTful Back-End API with Node.js and Express.js
Check HTTP status codes3m 17s
5. Connecting Your Application to MongoDB
6. User Authentication, JWTs, and Session Management
7. Finalizing Your Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.