You are not logged in.
Pages: 1
On which property of the TAuthUser class can we apply the TSynValidatePassWord validator? The following:
TAuthUser.AddFilterOrValidate('PasswordPlain', TSynValidatePassWord.Create())
raises an exception:
Project InsPumpSrv.exe raised exception class EOrmException with message 'TOrmPropInfoList.IndexByNameOrExcept(PasswordPlain): unkwnown field in TAuthUser'.
Offline
TAuthUser has no PasswordPlain published property
That was exactly the meaning of my message @ab. The TAuthUser class has no published property with the plain password and I presume that it is meaningless to apply this validator on the PasswordHasHexa property. So, on which property can we apply this password validator? Can we create a dummy, DTO like class (not a TOrm descendant, or if it is mandatory to be a TOrm child to not include it in the model creation, so to avoid having this table in our DB), with a plain password as published property, then apply this validator on this property and if it succeeds to use this value to assign it to the PasswordPlain property of the TAuthUser class instance?
Not a quite elegant solution...
Last edited by damiand (2023-09-11 09:09:32)
Offline
You can just create a TSynValidatePassWord instance with the appropriate password strength restrictions, then call TSynValidatePassWord.Process() with the text values.
No need to create an transient class.
Offline
Pages: 1