javascriptmeteortelescope

Override 'Login Forbidden' error message in meteor-useraccounts


I have built a basic Telescope Application. When I enter a wrong password it displays the error message 'Login Forbidden'. I want to change the error message something relevant to the action. Where and what code should I include to make the changes?


Solution

  • Instead of replacing the Accounts.validateLoginAttempt function, I recommend to configure a mapping via the meteor-accounts-t9n API (assuming you just want to replace the error message):

    1. Run meteor add softwarerero:accounts-t9n
    2. Add the following code:

    if (Meteor.isClient) {
        T9n.map('en', {
            error: {
                accounts: {
                    'Login forbidden': 'Credentials are incorrect!'
                }
            }
        });
    }