Skip to content

Message Surrounded by Angle Brackets for Some Login Errors #369

@freelancewebdev

Description

@freelancewebdev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions