Node.js API Masterclass with Express and MongoDB - User Register & Encrypting Passwords

Node.js API Masterclass with Express and MongoDB - User Register & Encrypting Passwords

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

The video tutorial covers setting up a user registration system using Mongoose, focusing on keeping controllers clean by using middleware for password hashing. It demonstrates testing the registration process and error handling using Postman. The tutorial also explains how to implement password encryption with bcrypt and outlines future steps to incorporate JSON web tokens for authentication and route protection.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary reason for using middleware in the registration process?

To keep the controllers clean and handle tasks like password hashing

To directly manage user input validation

To store user data in a temporary cache

To automatically generate user IDs

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which tool is used to test the registration process by sending HTTP requests?

Insomnia

cURL

Swagger

Postman

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to set the user role to 'admin' during registration?

The role is automatically set to 'user'

An error is returned indicating an invalid role

The request is ignored

The user is registered with admin privileges

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which library is used for password encryption in this tutorial?

bcrypt.js

bcrypt

argon2

crypto

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the recommended number of rounds for generating a salt with bcrypt.js?

20

15

10

5

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of implementing JSON web tokens in the application?

To authenticate users and protect routes

To store user preferences

To encrypt user passwords

To manage user sessions

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a route that should be protected using custom middleware?

Viewing a public profile

Adding a boot camp

Searching for users

Browsing courses

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?