Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuP6789 committed Nov 15, 2024
1 parent c08b79f commit 44cdf48
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react-dom": "^18"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
Expand Down
4 changes: 2 additions & 2 deletions src/app/api/auth/[...nextauth]/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const options: NextAuthOptions = {
placeholder: "your-password",
},
},
async authorize(credentials, req) {
async authorize(credentials) {
if (!credentials) {
return null; // or throw an error
}
Expand All @@ -29,7 +29,7 @@ export const options: NextAuthOptions = {
// to verify with credentials
// Docs: https://next-auth.js.org/configuration/providers/credentials

const user: User = await getUserByEmailServer(email);
const user: User | null = await getUserByEmailServer(email);

// Check if user exists and if password matches
if (user && (await compare(password, user.password))) {
Expand Down
3 changes: 1 addition & 2 deletions src/app/api/user/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PrismaClient } from "@prisma/client";
import { NextRequest, NextResponse } from "next/server";
import bcrypt from "bcrypt";
import bcrypt from "bcryptjs";

const prisma = new PrismaClient();

Expand Down Expand Up @@ -187,4 +187,3 @@ export const PUT = async (request: NextRequest) => {
});
}
};

6 changes: 3 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import ExampleSignUp from "@components/ExampleSignUp";

export default function Home() {
const [user, setUser] = useState<User | null>(null);
const [userID, setUserID] = useState<string>("");

return (
<div className="flex items-center justify-center h-screen flex-col space-y-4">
<CreateUserForm />
<CreateUserForm setUserID={setUserID} />
<ExampleSignUp setUser={setUser} />
{user && (
<div>
<h2>User Details:</h2>
<p>Name: {user.firstName}</p>
<p>Email: {user.email}</p>
<p>userID: {userID}</p>
{/* Display other user details as needed */}
</div>
)}
</div>
);
}


0 comments on commit 44cdf48

Please sign in to comment.