Fix: Use dynamic env for SERVICE_ROLE_KEY
Build and Push Docker Image / build (push) Successful in 1m49s
Details
Build and Push Docker Image / build (push) Successful in 1m49s
Details
$env/static/private reads at build time, not runtime. Changed to $env/dynamic/private so the key is read at runtime from the container environment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4039ec8187
commit
d4f47c5b20
|
|
@ -2,13 +2,13 @@ import pkg from '@supabase/ssr';
|
||||||
const { createServerClient } = pkg;
|
const { createServerClient } = pkg;
|
||||||
import { createClient as createSupabaseClient } from '@supabase/supabase-js';
|
import { createClient as createSupabaseClient } from '@supabase/supabase-js';
|
||||||
import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public';
|
import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public';
|
||||||
import { SUPABASE_SERVICE_ROLE_KEY } from '$env/static/private';
|
|
||||||
import { env } from '$env/dynamic/private';
|
import { env } from '$env/dynamic/private';
|
||||||
import type { Cookies } from '@sveltejs/kit';
|
import type { Cookies } from '@sveltejs/kit';
|
||||||
import type { Database } from '$lib/types/database';
|
import type { Database } from '$lib/types/database';
|
||||||
|
|
||||||
// Use internal URL for server-side operations (Docker network), fallback to public URL
|
// Use internal URL for server-side operations (Docker network), fallback to public URL
|
||||||
const SERVER_SUPABASE_URL = env.SUPABASE_INTERNAL_URL || PUBLIC_SUPABASE_URL;
|
const SERVER_SUPABASE_URL = env.SUPABASE_INTERNAL_URL || PUBLIC_SUPABASE_URL;
|
||||||
|
const SUPABASE_SERVICE_ROLE_KEY = env.SUPABASE_SERVICE_ROLE_KEY || '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Supabase client for server-side operations with cookie handling
|
* Create a Supabase client for server-side operations with cookie handling
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue