hoodiehq / hoodie-account-client

:dog: Account client API for the browser
https://hoodiehq.github.io/hoodie-account-client
Apache License 2.0
11 stars 24 forks source link

admin.accounts.find/update/remove(object) #96

Open courajs opened 8 years ago

courajs commented 8 years ago

Find, update, and remove are documented as accepting an object with an id, username, or token property, but currently only work when passed a string id. When passed an object they mistakenly try to GET http://localhost:4200/hoodie/account/api/accounts/[object%20Object]

gr2m commented 8 years ago

Great catch! That would make a great starter issue for https://github.com/hoodiehq/camp/issues :) Anyone feel free to go ahead and create one, otherwise I’ll get back to it as soon as I can

courajs commented 8 years ago

I'd enjoy creating my first starter issue 😀

How do we find a user by username? I couldn't figure it out from an (admittedly quick) look at hoodie-account-server.

Same for token. What are the tokens, and where do they come from?

We could also keep it super short and only add the .id option in the starter issue. Or do just id and username if the token is more complicated or not supported yet

gr2m commented 8 years ago

Tokens are currently out of scope. They can later be used for one-time logins, e.g. for password resets.

This one is actually tricky, I get back to it as soon as I can :) If you like we can also work on it together

courajs commented 8 years ago

We could in the meantime add {id: ...} support, and throw NotImplementedError or similar for username/token. Do you think that kind of thing is worth it in general? To match documentation?

gr2m commented 8 years ago

yeah, we did that in the past. NotImplementedError is great, and then ideally add URL to an open issue to fix it :)