fix(auth): restore middleware, fix setup redirect loop, and add next.config rewrites proxying Supabase requests
All checks were successful
Staging Build / build (push) Successful in 3m27s

This commit is contained in:
DanielS
2026-07-03 10:57:22 +02:00
parent 99f859cde3
commit f914e9cdf1
3 changed files with 19 additions and 1 deletions

View File

@@ -25,6 +25,23 @@ const nextConfig: NextConfig = {
},
];
},
async rewrites() {
const supabaseUrl = (process.env.SUPABASE_URL || "http://supabase-kong:8000").replace(/\/$/, "");
return [
{
source: '/auth/v1/:path*',
destination: `${supabaseUrl}/auth/v1/:path*`,
},
{
source: '/rest/v1/:path*',
destination: `${supabaseUrl}/rest/v1/:path*`,
},
{
source: '/storage/v1/:path*',
destination: `${supabaseUrl}/storage/v1/:path*`,
},
];
},
};
export default nextConfig;