1
- import NextAuth from 'next-auth'
2
- import Providers from 'next-auth/providers'
1
+ import NextAuth from "next-auth"
2
+ import EmailProvider from "next-auth/providers/email"
3
+ import GitHubProvider from "next-auth/providers/github"
4
+ import Auth0Provider from "next-auth/providers/auth0"
5
+ import TwitterProvider from "next-auth/providers/twitter"
6
+ import CredentialsProvider from "next-auth/providers/credentials"
3
7
4
8
// import Adapters from 'next-auth/adapters'
5
9
// import { PrismaClient } from '@prisma/client'
@@ -28,15 +32,15 @@ export default NextAuth({
28
32
// }
29
33
// },
30
34
providers : [
31
- Providers . Email ( {
35
+ EmailProvider ( {
32
36
server : process . env . EMAIL_SERVER ,
33
- from : process . env . EMAIL_FROM
37
+ from : process . env . EMAIL_FROM ,
34
38
} ) ,
35
- Providers . GitHub ( {
39
+ GitHubProvider ( {
36
40
clientId : process . env . GITHUB_ID ,
37
- clientSecret : process . env . GITHUB_SECRET
41
+ clientSecret : process . env . GITHUB_SECRET ,
38
42
} ) ,
39
- Providers . Auth0 ( {
43
+ Auth0Provider ( {
40
44
clientId : process . env . AUTH0_ID ,
41
45
clientSecret : process . env . AUTH0_SECRET ,
42
46
domain : process . env . AUTH0_DOMAIN ,
@@ -45,36 +49,36 @@ export default NextAuth({
45
49
// authorizationParams: {
46
50
// response_mode: 'form_post'
47
51
// }
48
- protection : ' pkce'
52
+ protection : " pkce" ,
49
53
} ) ,
50
- Providers . Twitter ( {
54
+ TwitterProvider ( {
51
55
clientId : process . env . TWITTER_ID ,
52
- clientSecret : process . env . TWITTER_SECRET
56
+ clientSecret : process . env . TWITTER_SECRET ,
53
57
} ) ,
54
- Providers . Credentials ( {
55
- name : ' Credentials' ,
58
+ CredentialsProvider ( {
59
+ name : " Credentials" ,
56
60
credentials : {
57
- password : { label : ' Password' , type : ' password' }
61
+ password : { label : " Password" , type : " password" } ,
58
62
} ,
59
- async authorize ( credentials ) {
60
- if ( credentials . password === ' password' ) {
63
+ async authorize ( credentials ) {
64
+ if ( credentials . password === " password" ) {
61
65
return {
62
66
id : 1 ,
63
- name : ' Fill Murray' ,
64
-
65
- image : ' https://www.fillmurray.com/64/64'
67
+ name : " Fill Murray" ,
68
+
69
+ image : " https://www.fillmurray.com/64/64" ,
66
70
}
67
71
}
68
72
return null
69
- }
70
- } )
73
+ } ,
74
+ } ) ,
71
75
] ,
72
76
jwt : {
73
77
encryption : true ,
74
- secret : process . env . SECRET
78
+ secret : process . env . SECRET ,
75
79
} ,
76
80
debug : false ,
77
- theme : ' auto'
81
+ theme : " auto" ,
78
82
79
83
// Default Database Adapter (TypeORM)
80
84
// database: process.env.DATABASE_URL
0 commit comments