Use bcryptjs instead of bcrypt

This commit is contained in:
Manuel
2023-08-05 11:19:52 +02:00
parent 6cbf5028c9
commit da57166fe7
5 changed files with 22 additions and 121 deletions

View File

@@ -1,6 +1,6 @@
import { UserSettings } from '@prisma/client';
import { TRPCError } from '@trpc/server';
import bcrypt from 'bcrypt';
import bcrypt from 'bcryptjs';
import { z } from 'zod';
import { hashPassword } from '~/utils/security';
import {

View File

@@ -1,5 +1,5 @@
import { PrismaAdapter } from '@next-auth/prisma-adapter';
import bcrypt from 'bcrypt';
import bcrypt from 'bcryptjs';
import Cookies from 'cookies';
import { type GetServerSidePropsContext, type NextApiRequest, type NextApiResponse } from 'next';
import { type DefaultSession, type NextAuthOptions, getServerSession } from 'next-auth';

View File

@@ -1,4 +1,4 @@
import bcrypt from 'bcrypt';
import bcrypt from 'bcryptjs';
export const hashPassword = (password: string, salt: string) => {
return bcrypt.hashSync(password, salt);