From a1a8b1c651b5040f084fd9b89ca68a2aab48a1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Ben=C3=ADtez?= Date: Sat, 20 Jun 2026 23:15:29 +0000 Subject: [PATCH] =?UTF-8?q?fix(sprint-5/etapa-4g):=20corregir=20clave=20lo?= =?UTF-8?q?calStorage=20en=20getAccessToken=20=E2=80=94=20supabase.auth.to?= =?UTF-8?q?ken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ProfileSheet.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ProfileSheet.tsx b/src/components/ProfileSheet.tsx index f033a50..fe59f82 100644 --- a/src/components/ProfileSheet.tsx +++ b/src/components/ProfileSheet.tsx @@ -10,10 +10,10 @@ import { useAuth } from '@/auth/AuthContext' // Lee el access token directamente de localStorage sin pasar por el cliente Supabase. // Evita contención con processLock — el save de perfil no necesita refresh de token // porque es una operación rápida y el token está fresco en sesiones activas. +// Clave verificada: STORAGE_KEY = 'supabase.auth.token' en @supabase/auth-js GoTrueClient. function getAccessToken(): string | null { try { - const projectRef = new URL(SUPABASE_URL).hostname.split('.')[0] - const raw = localStorage.getItem(`sb-${projectRef}-auth-token`) + const raw = localStorage.getItem('supabase.auth.token') if (!raw) return null const parsed = JSON.parse(raw) as { access_token?: string } return parsed.access_token ?? null