Why some of the functions from Accounts are undefined?

Hi !

I have imported Accounts from meteor/accounts-base. Why Accounts.setPassword is defined but when I console.log(Accounts.resetPassword) shows me undefined?

I want to use Accounts._hashPassword.

When I console.log(Accounts) it doesn’t show me resetPassword, but setPassword is there.

Thank you !

Are you running your code on the client or on the server? These methods are only available on the serverside

I am running on the serverside. Some of them are available some are not.

My bad. Some of them are available on client side.

Anyway I wanted to add passwords manually from server so I used hashPassword from ‘meteor-apollo-accounts’ and bcrypt with 10 rounds. I’ve transformed the password as loginWithPassword does.

1 Like