fix(frontend): remove unnecessary client-side session check in handleLink

The proxy handles auth via server-side Supabase session cookies.
The client-side getSession() call was returning null (store not
fully initialized) and bailing before the fetch ever happened.
This commit is contained in:
Bentlybro
2026-04-02 13:55:28 +00:00
parent 13e1980a95
commit 35a05a4b14

View File

@@ -50,24 +50,13 @@ export default function PlatformLinkPage() {
}, [token, user, isUserLoading]);
async function handleLink() {
if (!supabase) return;
setState({ status: "linking" });
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 30_000);
try {
const {
data: { session },
} = await supabase.auth.getSession();
if (!session?.access_token) {
setState({ status: "not-authenticated" });
return;
}
// The proxy injects auth from the server-side Supabase session,
// The proxy injects auth from the server-side Supabase session cookie,
// so we don't need to send Authorization ourselves.
const res = await fetch(
`/api/proxy/api/platform-linking/tokens/${token}/confirm`,