summaryrefslogtreecommitdiff
path: root/src/app/api/hash/route.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/api/hash/route.tsx')
-rw-r--r--src/app/api/hash/route.tsx10
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