Skip to content

Commit 091997f

Browse files
committed
increased bcrypt rounds to 14 for strong security
1 parent 9605729 commit 091997f

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

app/api/register/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const POST = async (request: any) => {
1212
return new NextResponse("Email is already in use", { status: 400 });
1313
}
1414

15-
const hashedPassword = await bcrypt.hash(password, 5);
15+
const hashedPassword = await bcrypt.hash(password, 14);
1616

1717
try {
1818
await prisma.user.create({

server/controllers/users.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function getAllUsers(request, response) {
1414
async function createUser(request, response) {
1515
try {
1616
const { email, password, role } = request.body;
17-
const hashedPassword = await bcrypt.hash(password, 5);
17+
const hashedPassword = await bcrypt.hash(password, 14);
1818

1919
const user = await prisma.user.create({
2020
data: {
@@ -34,7 +34,7 @@ async function updateUser(request, response) {
3434
try {
3535
const { id } = request.params;
3636
const { email, password, role } = request.body;
37-
const hashedPassword = await bcrypt.hash(password, 5);
37+
const hashedPassword = await bcrypt.hash(password, 14);
3838
const existingUser = await prisma.user.findUnique({
3939
where: {
4040
id: id,

server/controllers/wishlist.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const { PrismaClient } = require("@prisma/client");
22
const prisma = new PrismaClient();
3-
const bcrypt = require("bcryptjs");
43

54
async function getAllWishlist(request, response) {
65
try {

0 commit comments

Comments
 (0)