Skip to content

Commit 3596376

Browse files
fix(portal): fix build error to add AUTH_SECRET env to portal (#1590)
Co-authored-by: chasprowebdev <chasgarciaprowebdev@gmail.com>
1 parent ac1cc7f commit 3596376

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

apps/portal/src/app/lib/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { prismaAdapter } from 'better-auth/adapters/prisma';
55
import { nextCookies } from 'better-auth/next-js';
66
import { emailOTP, multiSession, organization } from 'better-auth/plugins';
77
import { ac, admin, auditor, employee, owner } from './permissions';
8+
import { env } from '@/env.mjs';
89

910
export const auth = betterAuth({
1011
database: prismaAdapter(db, {
@@ -16,7 +17,7 @@ export const auth = betterAuth({
1617
generateId: false,
1718
},
1819
trustedOrigins: ['http://localhost:3000', 'https://*.trycomp.ai'],
19-
secret: process.env.AUTH_SECRET!,
20+
secret: env.AUTH_SECRET!,
2021
plugins: [
2122
organization({
2223
membershipLimit: 100000000000,

apps/portal/src/env.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const env = createEnv({
1010
UPSTASH_REDIS_REST_TOKEN: z.string().optional(),
1111
AUTH_GOOGLE_ID: z.string(),
1212
AUTH_GOOGLE_SECRET: z.string(),
13+
AUTH_SECRET: z.string(),
1314
},
1415

1516
client: {
@@ -29,6 +30,7 @@ export const env = createEnv({
2930
UPSTASH_REDIS_REST_TOKEN: process.env.UPSTASH_REDIS_REST_TOKEN,
3031
AUTH_GOOGLE_ID: process.env.AUTH_GOOGLE_ID,
3132
AUTH_GOOGLE_SECRET: process.env.AUTH_GOOGLE_SECRET,
33+
AUTH_SECRET: process.env.AUTH_SECRET,
3234
},
3335

3436
skipValidation: !!process.env.CI || !!process.env.SKIP_ENV_VALIDATION,

0 commit comments

Comments
 (0)