Skip to content

Commit 7477bca

Browse files
authoredMay 18, 2023
Merge pull request vercel#28 from balazsorban44/patch-1
2 parents b88eadf + ef0df6c commit 7477bca

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed
 

‎app/api/auth/[...nextauth]/route.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import NextAuth, { NextAuthOptions } from "next-auth";
1+
import NextAuth, { type NextAuthOptions } from "next-auth";
22
import CredentialsProvider from "next-auth/providers/credentials";
33
import prisma from "@/lib/prisma";
44
import { compare } from "bcrypt";
55

66
export const authOptions: NextAuthOptions = {
77
providers: [
88
CredentialsProvider({
9-
credentials: {},
10-
// @ts-ignore
11-
async authorize(credentials, _) {
12-
const { email, password } = credentials as {
13-
email: string;
14-
password: string;
15-
};
9+
credentials: {
10+
email: { label: "Email", type: "email" },
11+
password: { label: "Password", type: "password" }
12+
},
13+
async authorize(credentials) {
14+
const { email, password } = credentials ?? {}
1615
if (!email || !password) {
1716
throw new Error("Missing username or password");
1817
}
@@ -29,7 +28,6 @@ export const authOptions: NextAuthOptions = {
2928
},
3029
}),
3130
],
32-
session: { strategy: "jwt" },
3331
};
3432

3533
const handler = NextAuth(authOptions);

0 commit comments

Comments
 (0)