From b41dda0439dc72b238df69af9a7ef74ffdb58b57 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Tue, 20 Dec 2016 17:48:35 -0200 Subject: [PATCH] Fix message when username field not exists in OAuth data Closes #5221 --- packages/rocketchat-custom-oauth/custom_oauth_server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-custom-oauth/custom_oauth_server.js b/packages/rocketchat-custom-oauth/custom_oauth_server.js index 1e6d37bfc1a..84abcb7df8b 100644 --- a/packages/rocketchat-custom-oauth/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/custom_oauth_server.js @@ -224,14 +224,14 @@ export class CustomOAuth { if (this.usernameField.indexOf('#{') > -1) { username = this.usernameField.replace(/#{(.+?)}/g, function(match, field) { if (!data[field]) { - throw new Meteor.Error(`Username template item "${field}" not found in data`, data); + throw new Meteor.Error('field_not_found', `Username template item "${field}" not found in data`, data); } return data[field]; }); } else { username = data[this.usernameField]; if (!username) { - throw new Meteor.Error(`Username field "${this.usernameField}" not found in data`, data); + throw new Meteor.Error('field_not_found', `Username field "${this.usernameField}" not found in data`, data); } }