fix: cleanup env variables

This commit is contained in:
David Nguyen
2025-02-13 20:56:44 +11:00
parent 7379391f92
commit 92db4d68db
31 changed files with 29 additions and 439 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
import { env } from '../utils/env';
import { NEXT_PUBLIC_WEBAPP_URL } from './app';
export const SALT_ROUNDS = 12;
@@ -49,7 +50,7 @@ export const MAXIMUM_PASSKEYS = 50;
// Todo: nextuauth_url ??
export const useSecureCookies =
env('NODE_ENV') === 'production' && String(env('NEXTAUTH_URL')).startsWith('https://');
env('NODE_ENV') === 'production' && String(NEXT_PUBLIC_WEBAPP_URL()).startsWith('https://');
// Todo: Test secure cookies prefix in remix.
const secureCookiePrefix = useSecureCookies ? '__Secure-' : '';
+1 -3
View File
@@ -34,8 +34,6 @@
"@pdf-lib/fontkit": "^1.1.1",
"@scure/base": "^1.1.3",
"@sindresorhus/slugify": "^2.2.1",
"@trigger.dev/sdk": "^2.3.18",
"@upstash/redis": "^1.20.6",
"@vvo/tzdb": "^6.117.0",
"csv-parse": "^5.6.0",
"inngest": "^3.19.13",
@@ -59,4 +57,4 @@
"@types/luxon": "^3.3.1",
"@types/pg": "^8.11.4"
}
}
}
-10
View File
@@ -1,10 +0,0 @@
/* eslint-disable turbo/no-undeclared-env-vars */
import { Redis } from '@upstash/redis';
import { env } from '../../utils/env';
// !: We're null coalescing here because we don't want local builds to fail.
export const redis = new Redis({
url: env('NEXT_PRIVATE_REDIS_URL') ?? '',
token: env('NEXT_PRIVATE_REDIS_TOKEN') ?? '',
});
-25
View File
@@ -1,25 +0,0 @@
import type { User as PrismaUser } from '@prisma/client';
import type { DefaultUser } from 'next-auth';
declare module 'next-auth' {
interface Session {
user: User;
}
interface User extends Omit<DefaultUser, 'id' | 'image' | 'emailVerified'> {
id: PrismaUser['id'];
name?: PrismaUser['name'];
email?: PrismaUser['email'];
emailVerified?: string | null;
}
}
declare module 'next-auth/jwt' {
interface JWT {
id: string | number;
name?: string | null;
email: string | null;
emailVerified?: string | null;
lastSignedIn?: string | null;
}
}
-4
View File
@@ -7,10 +7,6 @@ export const getBaseUrl = () => {
return '';
}
if (env('VERCEL_URL')) {
return `https://${env('VERCEL_URL')}`;
}
const webAppUrl = NEXT_PUBLIC_WEBAPP_URL();
if (webAppUrl) {