Kim
Kim

Reputation: 397

Meteor: accounts-password

I'm using accounts-password but I can't locate the user collection. Please help.enter image description here

After registering, I should see the following Instead, I keep getting an empty array without the registration data Also, in which file can I find the code for the users collection? In an effort to use best practices, I have separated my code into isClient, isServer, and both but I don't see the code anyway.

When I attempt to register a user in the browser I can't retrieve it using Meteor.users.find().fetch(); in the console.

Here's the my code:

Template.register.events({
    'submit form': function(event){
        event.preventDefault();
        var email = $('[name=email]').val();
        var password = $('[name=password]').val();
        Accounts.createUser({
            email: email,
            password: password
        });
        Router.go('home');
    }
});

When I attempt to register a user in the browser I can't retrieve user information using Meteor.users.find().fetch(); in the console. Registration form code:

<template name="register">
    <h2>Register</h2>
    <form class="register">
        <p>Email: <input type="email" name="email"></p>
        <p>Password: <input type="password" name="password"></p>
        <p><input type="submit" value="Register"></p>
    </form>
</template>

Upvotes: 0

Views: 234

Answers (1)

fabien
fabien

Reputation: 2258

meteor create hello
cd hello
meteor

=> go to http://localhost:3000

Then the collection is just Meteor.users. Try Meteor.users.find().fetch() in your console, you should get an empty Array : [] => it means it's all set up

Upvotes: 1

Related Questions