-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
ISSUE_NUMBER: GH-1
Description
The application uses process.env.FRONTEND_URL! without checking if the FRONTEND_URL environment variable is set. This can lead to a crash if the variable is not defined.
File: repositories/chatgptapi/src/app.ts
Line: 36
Severity: high
Current Behavior
The application assumes that process.env.FRONTEND_URL is always defined.
Expected Behavior
The application should check if process.env.FRONTEND_URL is defined and provide a default value or handle the case where it is not set.
Suggested Fix
Add a check for process.env.FRONTEND_URL and provide a default value or handle the error.
Code Context
app.use(cors({
origin: process.env.FRONTEND_URL!,
credentials: true,
}));Additional Notes
This affects application stability and can lead to unexpected crashes.
Reactions are currently unavailable