Scott explains the solution to exercise 11.
(asian music)…- [Scott] Anybody want to explain to me…what this function is doing?…Anybody want to take a guess,…just tell me?…I already told you, so I'm not going to tell you again,…I just want to know if,…if nobody has any questions,…then that means everybody knows…what this function is doing.…- [Student] [Inaudible 00:00:17]…- [Scott] Yeah, so it will look for the token…on req.headers.authorization,…and then, because we set it up up here,…up top, we already set it up,…it already knows the secret,…because we told it up here.…
It's holding a secret enclosure,…and it's going to match,…it's going to try to jwt.verify this token…with this secret.…And if it finds it,…it's going to grab whatever object is returned…and attach it to req.user,…and then call up next.…If the verification process fails,…it'll call next with an error.…If it doesn't find the token,…it'll call next with an error.…
Cool, so let's just start with the one…that you probably were doing first,…and that's verify user.…So anybody want to tell me what verify user is doing?…
This course was created by Frontend Masters. It was originally released on 12/30/2015. We're pleased to host this training in our library.
- Executing Node.js
- Using Express
- What is middleware?
- Testing in Node.js
- Using Mongo with Node.js
- Data modeling
- Querying data with Mongoose
- Identifying sensitive routes
- Configuring the deployment
Skill Level Intermediate
Building a Slack Bot with Node.js Microserviceswith Daniel Khan2h 9m Intermediate
Building APIs Using Hapi in Node.jswith Kirsten Hunter2h 23m Intermediate
2. REST APIs
5. Organization and Configuration
7. Data Modeling
10. Securing Routes
- 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.