fix: restore login by dropping broken Supabase Kong rewrite
Middleware getUser() could not validate the session cookie via the internal Docker hostname, so auth succeeded in the browser but kept redirecting back to /login stuck on "Verificando". Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,22 +7,6 @@ export async function createClient() {
|
||||
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
||||
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
||||
{
|
||||
global: {
|
||||
fetch: (url: string | URL | Request, options?: RequestInit) => {
|
||||
const u = new URL(url.toString());
|
||||
if (process.env.NODE_ENV === 'production' && u.hostname === 'supabase.4ventures.es') {
|
||||
u.protocol = 'http:';
|
||||
u.hostname = 'ventures-web-supabase-gm0nnn-supabase-kong';
|
||||
u.port = '8000';
|
||||
if (!options) options = {};
|
||||
if (!options.headers) options.headers = new Headers();
|
||||
const headers = new Headers(options.headers);
|
||||
headers.set('Host', 'supabase.4ventures.es');
|
||||
options.headers = headers;
|
||||
}
|
||||
return fetch(u.toString(), options);
|
||||
}
|
||||
},
|
||||
cookies: {
|
||||
getAll() {
|
||||
return cookieStore.getAll();
|
||||
|
||||
Reference in New Issue
Block a user