ı have an issue with Meteor.loginWithPassword method when creating my login page…
I implemented all the directions which are in the meteor docs but I was’t able to get result successfully…
my handleSubmit function for login form like that;
when I insert incorrect email or password i am getting errors (“user not found”, “incorrect password”) but when i insert correct email and password it gives nothing…
the email and password belong the user which i created with Accounts.createUser() …The user can be seen in my mongoDB users collection.
Also when i insert correct values for email and password, loginTokens has been creating in services.resume in my user document mongoDB…
I think this problem is cronic for new meteor versions because i have the same problem and haven’t solved yet…
Unfortunately, the sources about this issue are insufficent on developer forums
You can get a local copy of accounts-password have it hooked to your project and add some console logs inside internalLoginWithPassword that you can find in password_client.js
I am not sure you can use internalLoginWithPassword in your client. My point was to log some outputs from the internal mechanism of the package and see where a return is being blocked for you.
What I do: download this package as a zip: meteor/packages/accounts-password at devel · meteor/meteor · GitHub
Alternatively you can get the whole repo as a zip and only pull out this package from the zip.
In your main project folder (where you have package.json) create a folder named packages. Put accounts-password in the folder, go to its package.js and increase the version number. meteor remove accounts-password followed by meteor add accounts-password.
Now you should be running with your local version. This is the procedure to run any Meteor local package.
Now in the file I mentioned you can find the login function. Every update of a local package should trigger a restart of the dev server. If this doesn’t happen, make sure you restart the server to make sure you are running with the updated version of the local package.
I think I did what you said…I can get error result when an err occured, but on success there is no result…It seems missing in userCallback function “else” part.
Look, on OSX, all Meteor packages are under username/.meteor/packages/package_name/versions…
All previous versions are stored there. It happened to me in the past to have problems with some core packages after Meteor release updates. A new release would still use an old package in dev although the latest package was showing in the packages file.
I suggest you do a meteor remove for all accounts related packages and delete all related folders under meteor packages and then re-add the packages. Alternatively you can delete all packages and let Meteor reinstall all of them.
I think problem is related with the mongoDB version because i created a new meteor project with the latest mongo version and used same login component and then it works
I will try upgrade my main mongo version