How should I get the password field value inside the when
to compare the label value with the current value, so that I can strip the field?
*password: string().trim()
.notRequired()
.when(['$config', '$test', 'authenticationMethodType'],
(config: TestConfig, test: SyntheticPropertiesState,
authenticationMethodType: AuthenticationMethodType, schema: StringSchema):
StringSchema => {
const passwordPlaceholderCheck =
test?.authentication?.password !== Localize.PasswordPlaceholder;
if (passwordPlaceholderCheck) {
return schema.label(Localize.Password).required();
}
return schema.strip(true);
})
.max(63)
,*