-
Notifications
You must be signed in to change notification settings - Fork 186
Open
Description
Thanks for the great package - it has really saved me some work.
I have implemented Accounts.validateLoginAttempt with my own function which basically checks if the user's email is verified. Looks like:
// server/server.js
Meteor.startup(function(){
var isApproved = function(parameters) {
if (parameters.user && parameters.user.emails && (parameters.user.emails.length > 0)) {
var found = _.find(parameters.user.emails,function(thisEmail) { return thisEmail.verified });
if (typeof found === 'undefined') {
throw new Meteor.Error('not-approved','Not approved yet', 'Your account has not been approved yet. You will be informed by email when it is.')
}
return found && parameters.allowed;
} else {
return false;
}
}
Accounts.validateLoginAttempt(isApproved);
})When I try logging in with an account where the email has not been verified I get the error message returned in the alert box but it is surrounded by angle brackets as displayed:
To verify that it wasn't an issue with accounts-base or accounts-password I temporarily added the {{> loginButtons}} call in my layout and the error was displayed correctly.
I am also seeing the brackets on other but not all errors - one that I remember is showing the problem is 'incorrect password', however, 'no match' is displayed correctly.
Metadata
Metadata
Assignees
Labels
No labels
