104070159a
- Changed ORCID_REDIRECT_URI in docker-compose for updated ngrok URL. - Allowed all hosts in vite.config.js to support HTTPS tunnels during OAuth flows. - Improved handling of OAuth codes in AuthCallbackPage to prevent duplicate exchanges. - Added function to fetch ORCID display names to enrich researcher data in API service.
34 lines
1.0 KiB
JavaScript
34 lines
1.0 KiB
JavaScript
import { defineConfig, loadEnv } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, import.meta.dirname, '')
|
|
const proxyTarget = env.VITE_API_PROXY_TARGET || 'http://localhost:8000'
|
|
|
|
return {
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
host: true,
|
|
// Needed for HTTPS tunnels like ngrok during OAuth callback flows.
|
|
// We allow all hosts in dev to avoid host-blocking when ngrok URL rotates.
|
|
allowedHosts: true,
|
|
port: 5173,
|
|
proxy: {
|
|
// El backend agrupa todo bajo /api (researchers, export, …).
|
|
// Con un único prefijo evitamos tener que mantener una entrada
|
|
// por router cada vez que se añada un endpoint nuevo.
|
|
'/api': {
|
|
target: proxyTarget,
|
|
changeOrigin: true,
|
|
},
|
|
'/health': {
|
|
target: proxyTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
})
|