summaryrefslogtreecommitdiff
path: root/src/app/api/hash/route.tsx
blob: 2727e1f8cddf796f838e9e4e4574842b0ea96954 (plain)
1
2
3
4
5
6
7
8
9
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 });
}