Resolve build errors

This commit is contained in:
NeilClack
2026-07-17 11:51:14 -05:00
parent bcd216bd56
commit fd630ff714
4 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -2,9 +2,9 @@
FROM node:24-slim AS build
WORKDIR /app
# Placeholder values ONLY so `vite build` doesn't crash on $env/static/*
# imports during the build step. These are NOT the real runtime values —
# App Platform injects the real ones as env vars when the container runs.
# Placeholder values for build-time $env/static/* and better-auth's module-scope
# secret validation. These are NOT the real runtime values — App Platform
# injects the real ones as env vars when the container runs.
ARG DATABASE_URL=postgres://placeholder:placeholder@localhost:5432/placeholder
ARG ORIGIN=http://localhost:3000
ARG BETTER_AUTH_URL=http://localhost:3000
+2 -2
View File
@@ -1,8 +1,8 @@
import { BETTER_AUTH_URL } from '$env/static/private';
import { env } from '$env/dynamic/private';
import { sendMail } from './resend';
export async function sendVerificationEmail(options: { email: string; token: string }) {
const verificationUrl = `${BETTER_AUTH_URL}/api/auth/verify-email?token=${options.token}&callbackURL=/login?verified=true`;
const verificationUrl = `${env.BETTER_AUTH_URL}/api/auth/verify-email?token=${options.token}&callbackURL=/login?verified=true`;
await sendMail({
to: options.email,
+4 -4
View File
@@ -9,9 +9,9 @@
*
*/
import { Resend } from 'resend';
import { RESEND_API_KEY, EMAIL_FROM, RESEND_TEMPLATE_ID } from '$env/static/private';
import { env } from '$env/dynamic/private';
export const resend = new Resend(RESEND_API_KEY);
export const resend = new Resend(env.RESEND_API_KEY);
/**
* Send a transactional email using a Resend-hosted template.
@@ -39,11 +39,11 @@ export async function sendMail(options: {
const { to, subject, templateId, data } = options;
const result = await resend.emails.send({
from: EMAIL_FROM,
from: env.EMAIL_FROM,
to: [to],
subject: subject ?? 'Template Email',
template: {
id: templateId ?? RESEND_TEMPLATE_ID,
id: templateId ?? env.RESEND_TEMPLATE_ID,
variables: data ?? {}
}
});
@@ -3,7 +3,7 @@ import { json, error } from '@sveltejs/kit';
import { auth } from '$lib/auth';
import { prisma } from '$lib/db';
import { sendMail } from '$lib/server/resend';
import { BETTER_AUTH_URL } from '$env/static/private';
import { env } from '$env/dynamic/private';
function generateLicenseKey(): string {
const hex = crypto.randomUUID().replace(/-/g, '').slice(0, 16).toUpperCase();
@@ -53,8 +53,8 @@ export const POST: RequestHandler = async ({ request }) => {
});
const verifyUrl = verification
? `${BETTER_AUTH_URL}/api/auth/verify-email?token=${verification.value}&callbackURL=/login?verified=true`
: `${BETTER_AUTH_URL}/login`;
? `${env.BETTER_AUTH_URL}/api/auth/verify-email?token=${verification.value}&callbackURL=/login?verified=true`
: `${env.BETTER_AUTH_URL}/login`;
await sendMail({
to: email,
@@ -64,7 +64,7 @@ export const POST: RequestHandler = async ({ request }) => {
firstName: name ?? email.split('@')[0],
tempPassword,
verifyUrl,
loginUrl: `${BETTER_AUTH_URL}/login`
loginUrl: `${env.BETTER_AUTH_URL}/login`
}
});
} catch (err) {