forked from veomateorg/veomate-waitlist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
38 lines (32 loc) · 981 Bytes
/
next.config.ts
File metadata and controls
38 lines (32 loc) · 981 Bytes
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
import type { NextConfig } from 'next';
import crypto from 'crypto';
if (process.env.NODE_ENV === 'development') {
const ownerKey = process.env.VEOMATE_OWNER_KEY;
const REQUIRED_HASH =
'bf241f835d33c726188746d174c2ca81e7e321bc48014e7cd7b8480d22b7d335';
if (!ownerKey) {
console.error(
'\x1b[31m%s\x1b[0m',
'VEOMATE WAITLIST SECURITY: You are not authorized to run this development server.'
);
console.error(
'\x1b[31m%s\x1b[0m',
'Missing Owner Key. Please contact the repository owner.'
);
process.exit(1);
}
const providedHash = crypto
.createHash('sha256')
.update(ownerKey)
.digest('hex');
if (providedHash !== REQUIRED_HASH) {
console.error(
'\x1b[31m%s\x1b[0m',
'VEOMATE WAITLIST SECURITY: Access Denied.'
);
console.error('\x1b[31m%s\x1b[0m', 'The provided Owner Key is incorrect.');
process.exit(1);
}
}
const nextConfig: NextConfig = {};
export default nextConfig;