diff options
Diffstat (limited to 'src/app/api/hash')
| -rw-r--r-- | src/app/api/hash/route.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/app/api/hash/route.tsx b/src/app/api/hash/route.tsx new file mode 100644 index 0000000..2727e1f --- /dev/null +++ b/src/app/api/hash/route.tsx @@ -0,0 +1,10 @@ +import { NextRequest, NextResponse } from "next/server"; +import bcrypt from "bcrypt" + +export async function GET(request: NextRequest) { + const searchParams = request.nextUrl.searchParams; + const password = searchParams.get('password') ?? ''; + const hash = await bcrypt.hash(password, 10); + + return NextResponse.json({ hash }); +}
\ No newline at end of file |
