User verify with password

I’ve added a PDF signature workflow to my app that use private key and certificates for each user. Before they can sign some document, it is necessary to retype the password to verify the user one more time.

Is there a way to use some function that will verify the password that user typed in some textbox with his real hashed password?

If you look at the API docs for anvil.users, you’ll find there are some functions for logging in via code: Anvil Docs | anvil.users You could certainly try to login using login_with_email and if it works the password matched. I don’t know what happens to the currently logged in user if the password was wrong. You’d want to experiment with that.

Otherwise you’d need to work out what method Anvil uses to encrypt the password, and write your own Python code to compare the new password with it.

Thanks for the docs. It won’t work. It’s not kicking you out, but show the message that app experienced error: AuthenticationFailed.

That’s likely to be an exception being thrown. You can catch that using standard Python techniques.