Next.js · Middle · Question 37 of 75

In Next.js, how do you send only part of the DB data to the client so nothing extra (like a password hash) leaks?

Explanation

Everything in a client component's props is serialized into the HTML and RSC payload and visible in DevTools. A Data Access Layer that checks permissions and returns minimal DTOs is recommended. You can also use the taint API to forbid passing certain objects to the client.

Further reading

Problem with a question

Next.js · Middle · question 37

Test yourself

Take the Next.js · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz