With the authentication now fully implemented, Scott spends a few minutes testing the API with one of the seeded users in the database. He also answers a few questions about writing a custom authentication layer versus using other third-party libraries.
(asian music)…- [Scott] So let's check to see if that works.…So first we'll do is,…is let's just go get a user from seed.…We'll use this person,…we'll grab their username,…all the passwords are tests.…So I come over, I say http,…and then POST to signup,…localhost:3000/auth, right?…/auth because if you go to server.js,…/auth, right there, /auth,…and then if we go to that,…/signin.…
So /auth /signin.…/auth/signin, right, and then what we want to do…is post a username…equals that, and then password…equals test.…There we go, and we get a token back.…
See how that works?…If we look at the logs on the server,…we got a successful 200.…So yeah, that worked, everything worked, you're good.…Alright, now if I change it,…if I was like oh okay, let me try to sign in again…but I'm going to put the wrong password in.…So I what I expect to see,…I've got so many things open,…what I expect to see with the wrong password is this.…I should see wrong password.…That's what I should see.…Because what would happen…is the verify token would work,…
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
Node.js: Build Your First Microservicewith 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.