Fix missing env variable during build time
Some checks failed
Build Docker image / build (pull_request) Has been cancelled

This commit is contained in:
Roman Krček
2025-06-21 22:39:53 +02:00
parent 2c11e82424
commit f8fe8be1bf
4 changed files with 9 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import { createServerClient } from '@supabase/ssr'
import { type Handle, redirect } from '@sveltejs/kit'
import { sequence } from '@sveltejs/kit/hooks'
import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from '$env/static/public'
import { env } from '$env/dynamic/public'
const supabase: Handle = async ({ event, resolve }) => {
/**
@@ -10,7 +10,7 @@ const supabase: Handle = async ({ event, resolve }) => {
*
* The Supabase client gets the Auth token from the request cookies.
*/
event.locals.supabase = createServerClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, {
event.locals.supabase = createServerClient(env.PUBLIC_SUPABASE_URL, env.PUBLIC_SUPABASE_ANON_KEY, {
cookies: {
getAll: () => event.cookies.getAll(),
/**