mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-23 10:26:42 +00:00
Hash Password
This commit is contained in:
parent
e9fe5bb22a
commit
03db0eabad
@ -1,4 +1,5 @@
|
|||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
|
import bcrypt from 'bcryptjs';
|
||||||
import prisma from "@/app/prisma";
|
import prisma from "@/app/prisma";
|
||||||
|
|
||||||
interface Body {
|
interface Body {
|
||||||
@ -21,7 +22,7 @@ export async function POST(request: NextRequest) {
|
|||||||
username: body.username,
|
username: body.username,
|
||||||
name: body.name,
|
name: body.name,
|
||||||
email: body.email,
|
email: body.email,
|
||||||
password: body.password,
|
password: await bcrypt.hash(body.password, 10),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
0
app/api/user/login.ts/route.ts
Normal file
0
app/api/user/login.ts/route.ts
Normal file
10
package-lock.json
generated
10
package-lock.json
generated
@ -9,6 +9,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.8.2",
|
"@prisma/client": "^6.8.2",
|
||||||
|
"bcryptjs": "^3.0.2",
|
||||||
"daisyui": "^5.0.35",
|
"daisyui": "^5.0.35",
|
||||||
"lucide-react": "^0.511.0",
|
"lucide-react": "^0.511.0",
|
||||||
"next": "15.3.2",
|
"next": "15.3.2",
|
||||||
@ -1042,6 +1043,15 @@
|
|||||||
"@types/react": "^19.0.0"
|
"@types/react": "^19.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/bcryptjs": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-k38b3XOZKv60C4E2hVsXTolJWfkGRMbILBIe2IBITXciy5bOsTKot5kDrf3ZfufQtQOUN5mXceUEpU1rTl9Uog==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"bin": {
|
||||||
|
"bcrypt": "bin/bcrypt"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/busboy": {
|
"node_modules/busboy": {
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@prisma/client": "^6.8.2",
|
"@prisma/client": "^6.8.2",
|
||||||
|
"bcryptjs": "^3.0.2",
|
||||||
"daisyui": "^5.0.35",
|
"daisyui": "^5.0.35",
|
||||||
"lucide-react": "^0.511.0",
|
"lucide-react": "^0.511.0",
|
||||||
"next": "15.3.2",
|
"next": "15.3.2",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user