diff --git a/app/api/server/v1/chat.js b/app/api/server/v1/chat.js index b095228a1b88..9df879ba252f 100644 --- a/app/api/server/v1/chat.js +++ b/app/api/server/v1/chat.js @@ -127,7 +127,7 @@ API.v1.addRoute('chat.postMessage', { authRequired: true }, { post() { // WIDECHAT only let messageReturn; - if (this.user.username === 'viasat.notification.service') { + if (this.user.username === settings.get('Notification_Service_User_Username')) { const { hostname_id } = this.requestParams(); if (!hostname_id) { throw new Meteor.Error('error-hostname-id-not-provided', 'Body param "hostname_id" is required'); diff --git a/app/lib/server/startup/settings.js b/app/lib/server/startup/settings.js index e5e592fc0ada..a062a478ee98 100644 --- a/app/lib/server/startup/settings.js +++ b/app/lib/server/startup/settings.js @@ -952,6 +952,9 @@ settings.addGroup('General', function() { public: true, i18nDescription: 'Notifications_Always_Notify_Mobile_Description', }); + this.add('Notification_Service_User_Username', 'viasat.notification.service', { + type: 'string', + }); }); this.section('REST API', function() { return this.add('API_User_Limit', 500, {