Hi,
Funny you stumbled upon this. As I was thinking through it last night, I realized a setWithQuery would just be a getWithQuery followed up with an update. One of the issues with a setWithQuery method is that there is the possibility of returning multiple records, which will cause issues with the update command. So I don’t feel that a setWithQuery is the right solution right now.
Interestingly, the update command already has a third undocumented parameter that signifies whether a password is already hashed or not when updating the password. It takes a boolean value, the signature looks like so:
core.users.update(user\_id, data, is\_pw\_hashed)
Using that parameter will allow you to use a previously hashed password to update with. My biggest concern is developers double hashing passwords, which will render them useless, so I try to handle all of the password hashing internally.
Thinking through your use case more the sendConfirmationLink may be helpful, but the sendPasswordResetLink might not, as it simply redirects the user to a form to reset their password. It sounds like you want to handle how the password is set (I could be wrong).
In that case you will need to create your own logic using the Pages module. It’s actually not that difficult, and if you study the confirmation pages you should be able to understand how to do this. Those pages can be found here:
/home/coronium/pages/_coronium/registration/confirmation.lua
/home/coronium/pages/_coronium/registration/confirmation.tpl
I can also help walk you through this if needed. Your basically going to set up another database+table to hold a code that you can retrieve when the user hits your Pages endpoint and do your password logic at that point. If you wanted to keep it all internal to the app, you could possibly use the stored password as a key to change the password with (not fully sure on your implementation).
I’ve exposed the sendConfirmationLink method on the server-side, so I’m going to be prepping the v2.6.0 for release today. I think the other needs can be handled with whats available.
Feel free to ask any questions if you need some ideas on logic.
-dev