Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vercelignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ test-results/
/backend/
/supabase/
/docs/
/tmp/
/artifacts/
/scripts/
/DESIGN.md
/SECURITY.md
/AGENTS.md
14 changes: 13 additions & 1 deletion apps/web/integrations/supabase/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,19 @@ function createSupabaseBrowserClient(): SupabaseClient<Database> {
)
}

return createBrowserClient<Database>(supabaseUrl, supabaseAnonKey)
return createBrowserClient<Database>(supabaseUrl, supabaseAnonKey, {
isSingleton: true,
auth: {
persistSession: true,
autoRefreshToken: true,
detectSessionInUrl: true,
},
realtime: {
params: {
eventsPerSecond: 2,
},
},
})
}

export function getSupabaseBrowserClient(): SupabaseClient<Database> {
Expand Down
4 changes: 4 additions & 0 deletions apps/web/lib/supabase/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export function createClientForCookieStore(
}
},
},
auth: {
persistSession: false,
autoRefreshToken: false,
},
});
}

Expand Down
6 changes: 6 additions & 0 deletions apps/web/lib/supabase/service-role.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export function createSupabaseServiceRoleClient(): SupabaseClient<Database> {
auth: {
persistSession: false,
autoRefreshToken: false,
detectSessionInUrl: false,
},
global: {
headers: {
'X-Client-Info': 'tzudong-service-role',
},
},
});

Expand Down
2 changes: 2 additions & 0 deletions apps/web/tests-unit/vercel-ignore-build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ describe("Vercel ignored build branch policy", () => {
deploymentEnabled?: Record<string, boolean>;
};
ignoreCommand?: string;
regions?: string[];
};

expect(config.git?.deploymentEnabled).toEqual({
"*": false,
main: true,
develop: true,
});
expect(config.regions).toEqual(["icn1"]);
expect(config.ignoreCommand).toBe("node scripts/vercel-ignore-build.mjs");
});

Expand Down
1 change: 1 addition & 0 deletions apps/web/vercel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": "nextjs",
"regions": ["icn1"],
"installCommand": "npm ci",
"buildCommand": "npm run build",
"git": {
Expand Down
Loading