Skip to content

Commit

Permalink
Make notification service username a config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kb0304 committed May 13, 2020
1 parent 577e65f commit e6e5ec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/server/v1/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 3 additions & 0 deletions app/lib/server/startup/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,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, {
Expand Down

0 comments on commit e6e5ec8

Please sign in to comment.