feathersjs-ecosystem / feathers-authentication-management

Adds sign up verification, forgotten password reset, and other capabilities to local feathers-authentication
https://feathers-a-m.netlify.app/
MIT License
246 stars 98 forks source link

ensureObjPropsValid throws when an object with more props is passed in #224

Closed jd1378 closed 5 months ago

jd1378 commented 7 months ago

currently I'm passing my user object to the resendVerifySignup service method, and it is throwing error

the issue seems to be with this piece of code, which I assume ensures certain props exist with the right type, but fails if the object actually has more props than the required props: https://github.com/feathersjs-ecosystem/feathers-authentication-management/blob/7b73637bb1b8204a368d11e3c9117a4a6e6f3d92/src/helpers/index.ts#L63

which I guess should be something like this:

const valid = props.every(prop => keys.includes(prop) && typeof obj[prop] === 'string');