Limit Environment Variable Exposure: Loading Twilio credentials only when needed (inside the sendSMS function) will reduce unnecessary exposure, as they are not globally available.
Scoped Access: Adding a middleware function like roleCheck ensures that only users with specific roles (e.g., admin) can send SMS, restricting unauthorized access.
These changes improve both security and role-based functionality in the app
Limit Environment Variable Exposure: Loading Twilio credentials only when needed (inside the sendSMS function) will reduce unnecessary exposure, as they are not globally available.
Scoped Access: Adding a middleware function like roleCheck ensures that only users with specific roles (e.g., admin) can send SMS, restricting unauthorized access.
These changes improve both security and role-based functionality in the app