It seems that the function "Meteor.loginWithPassword" does not work when the method is called.
I want to create my autoform login form, and so I created a callback method that is called after the user has submitted the registration form. The form is called valid, but the loginWithPassword function does not work.
This is my method (client and server side)
Meteor.methods({ autoform_test_login : function (doc) { console.log('Called login method'); if (Meteor.isClient) { Meteor.loginWithPassword('test', 'test', function(e) { if (e) { console.log(e); } }); } } });
My autoforms call this method when submitted with:
{{#autoForm schema="Schema_Login" id="form_login" type="method" meteormethod="autoform_test_login"}} ....
When submitting this form, I get this error:
Error: No result from call to login {stack: (...), message: "No result from call to login"}
When I open the browser console now and type:
Meteor.call('autoform_test_login');
I get the same error.
But: When I type the following in my console, it works (Error now: Username not found):
Meteor.loginWithPassword('test', 'test', function(e) { if (e) { console.log(e); } });
My method does absolutely nothing, moreover, it breaks off, so I ask myself what is going wrong here.
Ps .: I know that I added "test" as Username and "test" as a password - itโs easy to verify it. Even when the input is correct, the error is always the same.