-
Notifications
You must be signed in to change notification settings - Fork 98
Invalid Data Received After Implementation #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
My guess is this could very well have to do with the Postgres column types, and in this case the timestamp type which is |
Aha, after browsing through source code, you don't convert the Date() |
As feathers is database agnostic the usual way to proceed is to use plain JS data types (eg Date Object or Number) then convert them with a hook if required for a specific database adapter. Typically |
Hooks were a thought, but performing the conversion in Objection's model (not via the PG adapter) before creation and after updates works fine instead. The thing I like about doing it this way, is my dates in the database are all consistent types. It's a small amount of overhead for a better design long term I think. |
Steps to reproduce
error: Invalid Data {"type":"FeathersError","name":"BadRequest","code":400,"className":"bad-request","errors":{},"hook":{"type":"before","method":"create","path":"users","params":{},"data":{"email":"[email protected]","password":"$2a$10$CtTO9UNaUVGFbgDYKncute.ZVtgPydSW6bOISeOoWjXdeIn9oBILa","name":"Testing","isVerified":false,"verifyExpires":1630680795297,"verifyToken":"1168d3e57d7eca580e7df29bea9577","verifyShortToken":"172955","verifyChanges":{}}}}
Expected behavior
Tell us what should happen
Shouldn't give Invalid Data error, as Postgres database fields match the fields the API expects.
Actual behavior
Tell us what happens instead
On user create via the users service, an error is returned so long as feathers-authenticaion-management is enabled. If I remove the verifyHooks.addVerification, user creation works fine again.
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
"feathers-authentication-management": "^3.1.0",
"@feathersjs/authentication": "^4.5.11",
"@feathersjs/authentication-local": "^4.5.11",
"@feathersjs/feathers": "^4.5.11",
NodeJS version:
14, latest stable
Operating System:
Mac OS Big Sur
The text was updated successfully, but these errors were encountered: