/
nuxt.config.ts
163 lines (162 loc) · 4.04 KB
/
nuxt.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import { NuxtConfig } from '@nuxt/types'
import oidcMockServer from './api/oidcmockserver'
export default <NuxtConfig>{
build: {
extractCSS: true
},
serverMiddleware: [
'~/api/auth',
'~/api/oauth2mockserver',
{
path: '/oidc',
handler: oidcMockServer({
port: 3000,
path: '/oidc',
redirect: {
callback: '/callback'
}
})
}
],
buildModules: ['@nuxt/typescript-build'],
modules: ['bootstrap-vue/nuxt', '@nuxtjs/axios', '../src/module'],
components: true,
axios: {
proxy: true
},
proxy: {
'/api': 'http://localhost:3000',
'/laravel': {
target: 'https://laravel-auth.nuxtjs.app',
pathRewrite: { '^/laravel': '/' }
}
},
auth: {
redirect: {
callback: '/callback',
logout: '/signed-out'
},
strategies: {
local: {
token: {
property: 'token.accessToken'
}
},
localRefresh: {
scheme: 'refresh',
token: {
property: 'token.accessToken',
maxAge: 15
},
refreshToken: {
property: 'token.refreshToken',
data: 'refreshToken',
maxAge: false
}
},
auth0: {
domain: 'nuxt-auth.auth0.com',
clientId: 'q8lDHfBLJ-Fsziu7bf351OcYQAIe3UJv'
},
discord: {
clientId: process.env.DISCORD_CLIENT_ID,
clientSecret: process.env.DISCORD_CLIENT_SECRET
},
facebook: {
endpoints: {
userInfo:
'https://graph.facebook.com/v2.12/me?fields=about,name,picture{url},email,birthday'
},
clientId: '1671464192946675',
scope: ['public_profile', 'email', 'user_birthday']
},
google: {
clientId:
'956748748298-kr2t08kdbjq3ke18m3vkl6k843mra1cg.apps.googleusercontent.com'
},
github: {
clientId: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET
},
// twitter: {
// clientId: 'FAJNuxjMTicff6ciDKLiZ4t0D'
// },
laravelJWT: {
url: '/laravel',
endpoints: {
login: {
url: '/api/auth/jwt/login'
},
refresh: {
url: '/api/auth/jwt/refresh'
},
logout: {
url: '/api/auth/jwt/logout'
},
user: {
url: '/api/auth/jwt/user'
}
}
},
laravelSanctum: {
url: '/laravel'
},
laravelPassport: {
url: 'https://laravel-auth.nuxtjs.app',
endpoints: {
userInfo: '/api/auth/passport/user'
},
token: {
maxAge: 1800
},
refreshToken: {
maxAge: 60 * 60 * 24 * 30
},
clientId: '3',
clientSecret: 'k0NAhYGKXbG6NjENFz4VIe5YSbccZWW9V3gGeSOa'
},
laravelPassportPasswordGrant: {
name: 'laravelPassportPassword',
provider: 'laravelPassport',
url: '/laravel',
endpoints: {
user: {
url: '/api/auth/passport/user'
}
},
token: {
maxAge: 1800
},
refreshToken: {
maxAge: 60 * 60 * 24 * 30
},
clientId: '2',
clientSecret: 'eKm1ei8muaql7TfcBxhN6Nq48oSflw6QJKCZF8gl',
grantType: 'password'
},
oauth2mock: {
scheme: 'oauth2',
endpoints: {
authorization: '/oauth2mockLogin',
token: '/oauth2mockserver/token',
userInfo: '/oauth2mockserver/userinfo'
},
responseType: 'code',
grantType: 'authorization_code',
clientId: 'test-client'
},
oidcmock: {
scheme: 'openIDConnect',
responseType: 'code',
scope: ['openid', 'profile', 'offline_access'],
grantType: 'authorization_code',
clientId: 'oidc_authorization_code_client',
logoutRedirectUri: 'http://localhost:3000',
endpoints: {
configuration:
'http://localhost:3000/oidc/.well-known/openid-configuration'
}
}
}
}
}