Skip to content

Commit

Permalink
Merge pull request #10 from Zeltharion/dev
Browse files Browse the repository at this point in the history
Bug Fix #3
  • Loading branch information
Zeltharion authored Oct 19, 2024
2 parents 6d80441 + 472e550 commit 4426d7c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 55 deletions.
45 changes: 0 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@types/bcrypt": "^5.0.2",
"@types/qs": "^6.9.16",
"@uploadthing/react": "^7.0.3",
"argon2": "^0.41.1",
"axios": "^1.7.7",
"bcrypt": "^5.1.1",
"class-variance-authority": "^0.7.0",
Expand Down
11 changes: 2 additions & 9 deletions shared/constants/authOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import GitHubProvider from 'next-auth/providers/github'
import GoogleProvider from 'next-auth/providers/google'
import CredentialsProvider from "next-auth/providers/credentials";
import { prisma } from "@/prisma/prismaClient";
import { compare } from "bcrypt";
import { compare, hashSync } from "bcrypt";
import { UserRole } from "@prisma/client";
import argon2 from "argon2";

export const authOptions: AuthOptions = {
providers: [
Expand Down Expand Up @@ -96,13 +95,7 @@ export const authOptions: AuthOptions = {
data: {
email: user.email,
fullName: user.name || "Пользователь #" + user.id,
password: await argon2.hash(user.id.toString(), {
type: argon2.argon2id,
hashLength: 32,
salt: Buffer.from(process.env.NEXTAUTH_SECRET!),
parallelism: 4,
timeCost: 4,
}),
password: hashSync(user.id.toString(), 10),
verified: new Date(),
provider: account?.provider,
providerId: account?.providerAccountId,
Expand Down

0 comments on commit 4426d7c

Please sign in to comment.