Accounts.validateLoginAttempt is not a function


#1

I installed useraccounts:unstyled and accounts-password.

When I try the code

import { Accounts } from 'meteor/accounts-base';
Accounts.validateLoginAttempt(function(options) {
    return true;
});

It gives me the error

Uncaught TypeError: Accounts.validateLoginAttempt is not a function
    at login.js (login.js:41)
    at fileEvaluate (modules-runtime.js?hash=d9c2212c27b8b694a403c725c46ea2897298b66e:353)
    at require (modules-runtime.js?hash=d9c2212c27b8b694a403c725c46ea2897298b66e:248)
    at home.js (home.js:1)
    at fileEvaluate (modules-runtime.js?hash=d9c2212c27b8b694a403c725c46ea2897298b66e:353)
    at require (modules-runtime.js?hash=d9c2212c27b8b694a403c725c46ea2897298b66e:248)
    at routes.js (routes.js:1)
    at fileEvaluate (modules-runtime.js?hash=d9c2212c27b8b694a403c725c46ea2897298b66e:353)
    at require (modules-runtime.js?hash=d9c2212c27b8b694a403c725c46ea2897298b66e:248)
    at index.js (index.js:1)

Why is it not working?


#2

Where are you doing this? Accounts.validateLoginAttempt is only available on the server.