Skip to content

Commit f975565

Browse files
🏷️ Fix type errors
1 parent c50f6c5 commit f975565

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pages/api/auth/[...nextauth].ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ import NextAuth, { type AuthOptions } from 'next-auth';
33
import GithubProvider from 'next-auth/providers/github';
44

55
export const authOptions = {
6-
providers: [
7-
GithubProvider({
8-
clientId: env.GITHUB_ID,
9-
clientSecret: env.GITHUB_SECRET
10-
})
11-
]
6+
providers:
7+
env.GITHUB_ID && env.GITHUB_SECRET
8+
? [
9+
GithubProvider({
10+
clientId: env.GITHUB_ID,
11+
clientSecret: env.GITHUB_SECRET
12+
})
13+
]
14+
: []
1215
} satisfies AuthOptions;
1316

1417
export default NextAuth(authOptions);

0 commit comments

Comments
 (0)