-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor]: Remove isSSOEnabled logic throughout the codebase #9462
base: main
Are you sure you want to change the base?
Conversation
Eliminated all references to `isSSOEnabled` across the frontend, backend, and configuration files. This change simplifies the codebase by removing unnecessary feature flag checks, associated logic, and environment variables. The SSO feature remains available without reliance on this flag.
if (environmentService.get('AUTH_SSO_ENABLED')) { | ||
app.use(session(getSessionStorageOptions(environmentService))); | ||
} | ||
app.use(session(getSessionStorageOptions(environmentService))); |
Check warning
Code scanning / CodeQL
Clear text transmission of sensitive cookie Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 19 hours ago
To fix the problem, we need to ensure that the secure
attribute is set on the session cookies. This can be done by modifying the session configuration to include the secure
attribute. Specifically, we should update the getSessionStorageOptions
function to set the secure
attribute based on the environment (e.g., only set it to true
if the application is running in production).
- Update the
getSessionStorageOptions
function to include thesecure
attribute in the session cookie options. - Ensure that the
secure
attribute is set totrue
when the application is running in a production environment.
-
Copy modified line R15 -
Copy modified lines R88-R90
@@ -14,2 +14,3 @@ | ||
import { getSessionStorageOptions } from 'src/engine/core-modules/session-storage/session-storage.module-factory'; | ||
import { SessionOptions } from 'express-session'; | ||
import { UnhandledExceptionFilter } from 'src/filters/unhandled-exception.filter'; | ||
@@ -86,3 +87,5 @@ | ||
// Enable session - Today it's used only for SSO | ||
app.use(session(getSessionStorageOptions(environmentService))); | ||
const sessionOptions: SessionOptions = getSessionStorageOptions(environmentService); | ||
sessionOptions.cookie.secure = process.env.NODE_ENV === 'production'; | ||
app.use(session(sessionOptions)); | ||
|
@FelixMalfait Do you want a command for the next migration to clean the flag in the database? |
Let's wait for the deploy before merging this PR :) |
Eliminated all references to
isSSOEnabled
across the frontend, backend, and configuration files. This change simplifies the codebase by removing unnecessary feature flag checks, associated logic, and environment variables. The SSO feature remains available without reliance on this flag.