Compare commits
2 Commits
fe1de2bbf9
...
318e2144f0
| Author | SHA1 | Date | |
|---|---|---|---|
| 318e2144f0 | |||
|
|
7c352d9e82 |
@@ -231,7 +231,7 @@ pub async fn create_app(db: DatabaseConnection) -> Result<Router, DbErr> {
|
|||||||
.url("/api-docs/openapi.json", ApiDoc::openapi());
|
.url("/api-docs/openapi.json", ApiDoc::openapi());
|
||||||
|
|
||||||
let allowed_origins = std::env::var("ALLOWED_ORIGINS")
|
let allowed_origins = std::env::var("ALLOWED_ORIGINS")
|
||||||
.unwrap_or_else(|_| "http://localhost:3000,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:8080".to_string());
|
.unwrap_or_else(|_| "http://localhost:3000,http://localhost:5173,http://localhost:5174,http://localhost:5175,http://localhost:8080,http://localhost:1420,http://tauri.localhost,https://tauri.localhost".to_string());
|
||||||
|
|
||||||
let origins: Vec<HeaderValue> = allowed_origins
|
let origins: Vec<HeaderValue> = allowed_origins
|
||||||
.split(',')
|
.split(',')
|
||||||
|
|||||||
@@ -12,6 +12,20 @@ export default defineConfig({
|
|||||||
? 'https://family-budget.duckdns.org'
|
? 'https://family-budget.duckdns.org'
|
||||||
: 'http://localhost:8080',
|
: 'http://localhost:8080',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
configure: (proxy) => {
|
||||||
|
if (process.env.TAURI_DEV_HOST) {
|
||||||
|
proxy.on('proxyRes', (proxyRes) => {
|
||||||
|
const cookies = proxyRes.headers['set-cookie'];
|
||||||
|
if (cookies) {
|
||||||
|
proxyRes.headers['set-cookie'] = cookies.map(cookie =>
|
||||||
|
cookie
|
||||||
|
.replace(/;\s*Secure/gi, '')
|
||||||
|
.replace(/;\s*Domain=[^;]*/gi, '')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev --prefix ../frontend",
|
"beforeDevCommand": "npm run dev --prefix ../frontend",
|
||||||
"devUrl": "http://localhost:5173",
|
"devUrl": "http://localhost:5173",
|
||||||
"beforeBuildCommand": "npm run build --prefix ../frontend",
|
"beforeBuildCommand": "VITE_API_BASE_URL=https://family-budget.duckdns.org/api npm run build --prefix ../frontend",
|
||||||
"frontendDist": "../frontend/dist"
|
"frontendDist": "../frontend/dist"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
|
|||||||
Reference in New Issue
Block a user