Next.js Discord

Discord Forum

hashing

Answered
astro posted this in #help-forum
Open in Discord
why does the response not contain hashed passwd?
return NextResponse.json(
  {
    ...req,
    password: bcrypt.hash(req.password, 10)
  },
  { status: 400 }
);

5 Replies

Answer
dam
was going to say use await
This is how you hash. That is the async api. There is also a sync version(hashSync) but i recommend you use this
@averydelusionalperson was going to say use `await`
Yes, that should work