-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.config.ts
36 lines (32 loc) · 891 Bytes
/
auth.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import CredentialsProvider from 'next-auth/providers/credentials';
import GithubProvider from 'next-auth/providers/github';
const authConfig = {
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID ?? '',
clientSecret: process.env.GITHUB_SECRET ?? '',
}),
CredentialsProvider({
credentials: {
email: { label: 'Email', type: 'email' },
password: { label: 'Password', type: 'password' },
},
async authorize(credentials) {
const user = {
id: '1',
name: 'John',
email: credentials?.email as string,
};
if (user) {
return user; // Authentication succeeded
}
return null; // Authentication failed
},
}),
],
pages: {
signIn: '/', // Custom sign-in page
},
secret: process.env.NEXTAUTH_SECRET,
};
export default authConfig;