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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@astrojs/check": "^0.9.10",
"@astrojs/tailwind": "^6.0.2",
"@astrojs/ts-plugin": "^1.10.12",
"@supabase/ssr": "^0.12.7",
"@supabase/supabase-js": "^2.116.0",
"astro": "^7.3.3",
"tailwindcss": "^3.4.1",
Expand Down
17 changes: 17 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions src/lib/supabase.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import {createClient} from '@supabase/supabase-js';
import {createBrowserClient} from '@supabase/ssr';

// Same Supabase project the iOS app uses (~/code/insider-trading-app). The
// publishable key is safe to embed client-side — RLS, not key secrecy,
// protects data (insider-trading-app DESIGN.md §3.4b).
export const supabase = createClient(
//
// createBrowserClient (not plain createClient) stores the session -- and,
// critically, the PKCE code_verifier used mid-OAuth-redirect -- in a cookie
// instead of localStorage. Safari's Intelligent Tracking Prevention can evict
// localStorage written just before a redirect through a shared domain like
// supabase.co, which silently broke Google sign-in on Safari (the code
// exchange had nothing to read the verifier back from). Cookies set during a
// top-level navigation aren't subject to that restriction. No backend
// required -- this works in a plain client-rendered page, not just SSR
// frameworks.
export const supabase = createBrowserClient(
import.meta.env.PUBLIC_SUPABASE_URL,
import.meta.env.PUBLIC_SUPABASE_PUBLISHABLE_KEY
);
Loading