There are some irreversible actions that user can do in my app. To add a level of security, I'd like to verify that the person performing such an action is actually the logged in user. How can I achieve it?
For users with passwords, I'd like a prompt that would ask for entering user password again. How can I later verify this password, without sending it over the wire?
Is a similar action possible for users logged via external service? If yes, how to achieve it?
I haven't done this before, but I think you will need something like this on your server
then you can call this function from the client side like this:
I have a project on github for different purpose, but you can get a sense of how it is structured: https://github.com/534N/apitest
Hope this helps,
I can help with the first question. As of this writing, meteor doesn't have a
checkPassword
method, but here's how you can do it:On the client, I'm going to assume you have a form with an input called
password
and a button calledcheck-password
. The event code could look something like this:Then on the server, we can implement the
checkPassword
method like so:For more details, please see my blog post. I will do my best to keep it up to date.