idanwe / accounts-password-client-side

Use Meteor's accounts-password package with meteor-client-side.
MIT License
13 stars 10 forks source link

Create user but do not login afterwards #7

Closed mariohmol closed 8 years ago

mariohmol commented 8 years ago

Hi there!

First of all, very nice project, very helpfull!!

I'm trying to make the ionic2 example with accounts-password instead.

https://github.com/mariohmol/ionic2-meteor-messenger

I can install, run , create a user and when i try to login ,always get "User not found [403]".

Here is the backend where create the user

It appears on mongo db:

But cant login afterwards, here is how i'm using on client:

Any ideias?

thanks!

mariohmol commented 8 years ago

I found the error.. my user has just a username as a email..so he does not have a email attribute.

and the selector if checking if has @ to find by email.. isnt possible to make a equals username OR email?

https://github.com/idanwe/accounts-password-client-side/blob/master/dist/accounts-password-client-side.bundle.js#L1698

idanwe commented 8 years ago

@mariohmol, Good to hear that you solved it.

I saw that you had multiple issues about this problem. Therefor, does the package work for you? Does the issue can be closed?

Regard your question, as far as I know you need to explicit pass object for email or username. Otherwise, pass a string to the method will try to identify the "type" by the existence of @ accounts-password code.

mariohmol commented 8 years ago

Yes.. i could made it working using user and email, but if you see this link:

There for instance says an use email or username:

"user Object or String Either a string interpreted as a username or an email; or an object with a single key: email, username or id. Username or email match in a case insensitive manner"

But if i do that using this module it required to pass both and to be honest thats allright.. tha only suggestion that i would do is about documentation on readme.. someome code snippets in readme and tips like this (must use email and user).. would be great..

idanwe commented 8 years ago

@mariohmol it shouldn't be different from what the meteor docs says. Due to it is client side of the meteor code just bundled separately. So, you don't need to expect for any differences.

mariohmol commented 8 years ago

I see.. so maybe there need to be fixed.. but anyway.. if you point your readme to this link https://guide.meteor.com/accounts.html#accounts-password would be good!

.. and even there i cant find a example using loginWithPassword.. its crazy...

idanwe commented 8 years ago

Would you like to make a PR for that?