New Issue Checklist
Issue Description
Incorrect passwordPolicy Option validatorCallback typing.
The typing of the validatorCallback is () => void right now.
The spec uses this as () => bool
The rest prototype uses this as (password: string) => bool
Steps to reproduce
Add a passwordPolicy validatorCallback with correct typing:
const validatePassword = (password: string): boolean => {
console.log('Validating password security');
return password === 'badpw' ? false : true;
};
Actual Outcome
Type '(password: string) => boolean' is not assignable to type '() => void'.
Target signature provides too few arguments. Expected 1 or more, but got 0.ts(2322)
index.d.ts(229, 5): The expected type comes from property 'validatorCallback' which is declared here on type 'PasswordPolicyOptions'
Expected Outcome
No typescript error.
Environment
I am using 9.9.0, but this is also on the alpha branch at time of writing.
Server
- Parse Server version:
9.9.0
- Operating system:
N/A
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local
Database
- System (MongoDB or Postgres):
N/A
- Database version:
N/A
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
N/A
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
N/A
- SDK version:
N/A
Happy to fill those out more if you think it will be helpful!
Logs
New Issue Checklist
Issue Description
Incorrect
passwordPolicyOptionvalidatorCallbacktyping.The typing of the
validatorCallbackis() => voidright now.The spec uses this as
() => boolThe rest prototype uses this as
(password: string) => boolSteps to reproduce
Add a
passwordPolicyvalidatorCallbackwith correct typing:Actual Outcome
Expected Outcome
No typescript error.
Environment
I am using
9.9.0, but this is also on the alpha branch at time of writing.Server
9.9.0N/ALocalDatabase
N/AN/AN/AClient
N/AN/AHappy to fill those out more if you think it will be helpful!
Logs