Differential / accounts-entry

Meteor sign up and sign in pages
http://github.differential.com/accounts-entry/
MIT License
305 stars 189 forks source link

Message Surrounded by Angle Brackets for Some Login Errors #369

Open freelancewebdev opened 9 years ago

freelancewebdev commented 9 years ago

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:

accountentry

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.

queso commented 9 years ago

This package isn't really being maintained anymore. I would look at UserAccounts.

freelancewebdev commented 9 years ago

Thanks for that. I was actually listening to your podcasts later and heard you mention that. Might be good to stick a note in the readme to let others know. On 22 May 2015 15:39, "Josh Owens" notifications@github.com wrote:

This package isn't really being maintained anymore. I would look at UserAccounts.

— Reply to this email directly or view it on GitHub https://github.com/Differential/accounts-entry/issues/369#issuecomment-104676637 .