mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
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:
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user