Skip to content

Commit

Permalink
feat(session-storage): enable proxy configuration
Browse files Browse the repository at this point in the history
Added proxy support to session storage to better handle proxied requests. Removed redundant 'trust proxy' app setting in the main file to streamline proxy handling within session storage. This ensures consistent and centralized proxy configuration.
  • Loading branch information
AMoreaux committed Jan 20, 2025
1 parent 2de750f commit f8c5212
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const getSessionStorageOptions = (
secret: environmentService.get('SESSION_STORE_SECRET'),
resave: false,
saveUninitialized: false,
proxy: true,
cookie: {
secure: !!(SERVER_URL && SERVER_URL.startsWith('https')),
maxAge: 1000 * 60 * 30, // 30 minutes
Expand Down
3 changes: 0 additions & 3 deletions packages/twenty-server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ const bootstrap = async () => {
// Inject the server url in the frontend page
generateFrontConfig();

// Trust the first proxy to ensure correct client IP and protocol detection.
app.set('trust proxy', 1);

await app.listen(environmentService.get('PORT'));
};

Expand Down

0 comments on commit f8c5212

Please sign in to comment.