Skip to content

Commit

Permalink
fix temporarily login error message - drop it
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Mar 27, 2024
1 parent 4f80ac9 commit e6f31fc
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions apps/meteor/app/lib/server/lib/loginErrorMessageOverride.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// Do not disclose if user exists when password is invalid
import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';
// import { Meteor } from 'meteor/meteor';

const { _runLoginHandlers } = Accounts;
Accounts._runLoginHandlers = function (methodInvocation, options) {
const result = _runLoginHandlers.call(Accounts, methodInvocation, options);
// const { _runLoginHandlers } = Accounts;

if (result.error && result.error.reason === 'Incorrect password') {
result.error = new Meteor.Error(403, 'User not found');
}
Accounts._options.ambiguousErrorMessages = false;
// Accounts._runLoginHandlers = async function (methodInvocation, options) {
// const result = await _runLoginHandlers.call(Accounts, methodInvocation, options);

return result;
};
// // if (result.error && result.error.reason === 'Incorrect password') {
// // result.error = new Meteor.Error(403, 'User not found');
// // }

// return result;
// };

0 comments on commit e6f31fc

Please sign in to comment.