-
Notifications
You must be signed in to change notification settings - Fork 1
fix: remove hardcoded secrets, restrict CORS, add auth to debug endpoints #423
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,7 +105,7 @@ export default function RootLayout({ | |
| window.OneSignalDeferred = window.OneSignalDeferred || []; | ||
| OneSignalDeferred.push(async function(OneSignal) { | ||
| await OneSignal.init({ | ||
| appId: "${process.env.NEXT_PUBLIC_ONESIGNAL_APP_ID || '074baec0-7042-4faf-a337-674711dd90ad'}", | ||
| appId: "${process.env.NEXT_PUBLIC_ONESIGNAL_APP_ID || ''}", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Guard the OneSignal.init call when NEXT_PUBLIC_ONESIGNAL_APP_ID is missing. Passing an empty appId still initializes the SDK and can trigger runtime errors or fail to register notifications. Prompt for AI agents |
||
| }); | ||
| }); | ||
| `, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| */ | ||
|
|
||
| const ONESIGNAL_API_URL = 'https://onesignal.com/api/v1/notifications'; | ||
| const ONESIGNAL_APP_ID = process.env.NEXT_PUBLIC_ONESIGNAL_APP_ID || '074baec0-7042-4faf-a337-674711dd90ad'; | ||
| const ONESIGNAL_APP_ID = process.env.NEXT_PUBLIC_ONESIGNAL_APP_ID || ''; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Guard against a missing OneSignal app id before sending the notification. With the new empty-string fallback, requests will send an empty Prompt for AI agents |
||
| const ONESIGNAL_REST_API_KEY = process.env.ONESIGNAL_REST_API_KEY; | ||
|
|
||
| interface OneSignalNotification { | ||
|
|
@@ -155,4 +155,4 @@ export async function sendOneSignalToSegments( | |
| imageUrl: options?.imageUrl, | ||
| segments | ||
| }); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: This endpoint is labeled admin-level and uses createAdminClient, but the new guard only checks that a user is logged in. Any authenticated user can run the storage repair across all databases. Add an admin access check (e.g., checkAdminAccess or equivalent) before running admin operations.
Prompt for AI agents