I can register the user, send him an email and see him in Meteor.users so far, that works ... After logging out and trying to log in, I get an error
This is the error I get: Meteor.Error {error: 403, reason: "User not found", details: undefined}
In my console, if I do this: Meteor.users
I see my user there: a46e6e5a-03dd-4bef-9ea7-eb08ba6c2cd9: Object _id: "a46e6e5a-03dd-4bef-9ea7-eb08ba6c2cd9" username: " myemail@gmail.com "
Proto : Object
Here is my code:
if (Meteor.isClient) {
Template.landing.events({
'click #login-btn' : function () {
var username = $('#input-email').val();
var password = $('#input-password').val();
console.log(username);
Meteor.loginWithPassword(username, password, function(err){
if (err) {
console.log(err);
};
});
},
'click #invite-btn' : function () {
},
'click #signup-btn' : function () {
var options = {
username: $('#input-email').val(),
password: $('#input-password').val()
};
Accounts.createUser(options, function(err){
if (err) {
console.log(err);
}else{
$('#myModal').modal('hide');
Meteor.call('sendEmail',
$('#input-email').val(),
'update@mydomain.com',
'Thanks for requesting a invite code',
'We are glad you signed up for a invite to SlideSlider. We are working to get our closed bate up and running. Please stay tuned.');
}
});
}
});
Template.loggedin.events({
'click #logout-btn' : function () {
Meteor.logout();
}
});
}
if (Meteor.isServer) {
Meteor.methods({
sendEmail: function (to, from, subject, text) {
this.unblock();
console.log("send email");
Email.send({
to: to,
from: from,
subject: subject,
text: text
});
}
});
}
Any help would be awesome, by the way, this is my first stack question :)