Files
Zayden-Jung c187cd22ed integrate backend Google OAuth and set up avatar media proxy
- Implement the full login and onboarding workflow to handle name, handle, and avatar.

- Rewrite avatar asset URLs to route through the self-hosted media service.

- Add Next.js rewrites configuration to proxy media requests directly to the FastAPI backend.
2026-05-20 17:27:16 +08:00

34 lines
745 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
port: '',
pathname: '/**',
},
{
protocol: 'http',
hostname: 'googleusercontent.com',
port: '',
pathname: '/**',
},
],
},
async rewrites() {
return [
{
// 捕获所有以 /v1/media/ 开头的图片请求
source: '/v1/media/:path*',
// 悄悄转发给 FastAPI 后端
destination: `${process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000'}/v1/media/:path*`,
},
];
},
};
export default nextConfig;