Passphrase is not hashed in workflow

Hi

I found some problem
if I create a user through a workflow and send some passphrase to the password field, this passphrase is not hashed and is written to the database in pure form


Annotation%202020-01-08%20145503

Does anyone know how to solve this problem?
thanks

I assume this just was never implemented. What exactly is the use case here?

Why would you write up a constant password via a workflow? If you’re creating a new user and want to put in a default password, you might as well use the hashed value, right?

User enters their password through the form (cf7 WP) on the main site
I need him to be able to use this passphrase

Also, when creating a new user through a workflow, sending mail for a new user does not work

Hhm I see

Exactly how is this Workflow triggered? Which module, workflow type, etc?

i use this webhook /index.php?entryPoint=WebToLeadCapture to create lead
then in the workflow I track leads with a specific marketing campaign ID
workflow maps lead data to new user data
everything works except for a passphrase

About this :point_up:

If trying to use the email address from the user record, The sequence would need to be

  • create the user
  • create the relationship between the current lead and the new user
  • now try to send the email

If you’re just using the email address that comes with the Lead, it should just work (although the email sent might not become related to the user).

Check if your system account is operational under Admin / Outbound email, and check if your Scheduler jobs (cron) are running well.

Ok, so assuming this isn’t implemented (I didn’t go and check the code), you could

  1. Implement it in Core! Find the place in the Workflow code where fields are handled, add a condition if this is a password field, then hash it
  2. Implement it before sending into SuiteCRM. If your site can add a bit of Javascript code to hash the password before creating the lead, great. You’d have to find out exactly how SuiteCRM hashes it, and find a Javascript function or library that does the same.
  3. Implement it after creating the user. Make an after_save Logic Hook in Users module that hooks the user creation and replaces the clear-text password with the hashed version. Remember to add some condition to differentiate this from the normal (manual) user creation process so that you don’t break that one.