Skip to content

Commit

Permalink
Don't override specific error messages with generic ones.
Browse files Browse the repository at this point in the history
Addresses meteor#1960.
  • Loading branch information
n1mmy committed Apr 3, 2014
1 parent db8c05b commit f1f29d2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/accounts-base/accounts_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,19 @@ var validateLogin = function (connection, attempt) {
}
catch (e) {
attempt.allowed = false;
// XXX this means the last thrown error overrides previous error
// messages. Maybe this is surprising to users and we should make
// overriding errors more explicit. (see
// https://github.com/meteor/meteor/issues/1960)
attempt.error = e;
return true;
}
if (! ret) {
attempt.allowed = false;
attempt.error = new Meteor.Error(403, "Login forbidden");
// don't override a specific error provided by a previous
// validator or the initial attempt (eg "incorrect password").
if (!attempt.error)
attempt.error = new Meteor.Error(403, "Login forbidden");
}
return true;
});
Expand Down

0 comments on commit f1f29d2

Please sign in to comment.