-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
79 lines (73 loc) · 2.45 KB
/
next.config.ts
File metadata and controls
79 lines (73 loc) · 2.45 KB
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
import type { NextConfig } from 'next'
import './src/lib/env/client'
import './src/lib/env/server'
const NEXT_PUBLIC_SERVER_URL = process.env.VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
: process.env.NEXT_PUBLIC_SERVER_URL
const NEXTAUTH_URL = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : process.env.NEXTAUTH_URL
const contentSecurityPolicy = `
default-src 'self';
connect-src 'self' https://accounts.google.com https://*.okto.tech https://*.oktostage.com;
frame-src 'self' https://accounts.google.com;
frame-ancestors 'self';
script-src 'self' https://accounts.google.com 'unsafe-inline' 'unsafe-eval';
script-src-elem 'self' https://accounts.google.com 'unsafe-inline';
worker-src 'self' blob:;
style-src 'self' https://accounts.google.com 'unsafe-inline';
img-src 'self' https://lh3.googleusercontent.com https://s2.coinmarketcap.com data: blob:;
object-src 'self' data: blob:;
`
.replace(/\s{2,}/g, ' ')
.trim()
const nextConfig: NextConfig = {
devIndicators: false,
env: {
NEXTAUTH_URL,
NEXT_PUBLIC_SERVER_URL,
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
pathname: '**',
},
{
protocol: 'https',
hostname: 's2.coinmarketcap.com',
pathname: '**',
},
],
},
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Cross-Origin-Embedder-Policy',
value: 'require-corp',
},
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin',
},
{
key: 'Cross-Origin-Resource-Policy',
value: 'same-site',
},
{
key: 'Permissions-Policy',
value: 'identity-credentials-get=*',
},
{
key: 'Content-Security-Policy',
value: contentSecurityPolicy,
},
],
},
]
},
reactStrictMode: true,
}
export default nextConfig