Security and code quality fixes for PR #217 review comments#250
Merged
rafiqul4 merged 3 commits intosubscriptionmodelfrom Feb 16, 2026
Merged
Security and code quality fixes for PR #217 review comments#250rafiqul4 merged 3 commits intosubscriptionmodelfrom
rafiqul4 merged 3 commits intosubscriptionmodelfrom
Conversation
Merged
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Remove unused imports (DialogTrigger, notifyGracePeriod, notifySubscriptionExpired, isValidTransition, Suspense) - Comment out unused SmsChannel class in notification service - Fix TypeScript React.CSSProperties import issue in admin subscriptions page - Fix cron authentication to use single Bearer token method with constant-time comparison - Add webhook signature verification to prevent spoofed callbacks - Add security warning to subscription middleware about x-store-id header trust - Gate PII logging behind NODE_ENV development checks in signup and stores routes - Fix error handling to return 400 for validation errors (not 500) - Protect demo and test endpoints with production environment checks - Fix webhook gateway default from 'stripe' to 'sslcommerz' - Update .env.example to use placeholder values instead of real credentials - Secure test scripts by loading credentials from environment variables - Remove node-fetch dependency from test scripts (use built-in Node.js fetch) Co-authored-by: rafiqul4 <124497017+rafiqul4@users.noreply.github.com>
Add detailed documentation covering: - All completed security and code quality fixes - Remaining architectural issues with design recommendations - Testing validation results - Deployment recommendations and checklists - Next steps for implementation Co-authored-by: rafiqul4 <124497017+rafiqul4@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix critical bugs in subscription management system
Security and code quality fixes for PR #217 review comments
Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses actionable security vulnerabilities and code quality issues identified in PR #217 review. Implements production-hardening for authentication, webhooks, and test endpoints.
Security Fixes
Cron Authentication
x-cron-secretORauthorization)Webhook Signature Verification
MD5(transaction_id + store_password))PII Logging
NODE_ENV === 'development'Endpoint Protection
/api/demo/create-store,/api/subscriptions/init-trial)Credentials
.env.exampleuses placeholders (no real credentials)Code Quality
Unused Imports
DialogTrigger,notifyGracePeriod,notifySubscriptionExpired,isValidTransition,SuspenseSmsChannelclassError Handling
TypeScript
React.CSSPropertiesimport (import type { CSSProperties } from 'react')node-fetchdependency (use built-in Node.js 18+ fetch)Configuration
'sslcommerz'(only registered gateway)Documentation
Added
PR_217_REVIEW_FIXES_SUMMARY.mdNotes
x-store-id Security Warning
Added documentation to
src/lib/subscription/middleware.tsclarifying thatx-store-idheader should only be used for internal/admin routes. User-facing routes must derive storeId from authenticated session.Validation
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.