TypeError: Cannot read property 'username' of undefined
When I run curl -X POST -d '{"username": "foo", "password": "bar"}' https://myhomebase.foo/v1/accounts/login and with the following .homebase.yml configuration:
webapi:
domain: myhomebase.foo
username: foo
password: bar
I keep receiving a HTTP 500 and seeing TypeError: Cannot read property 'username' of undefined.
I'm on homebase 2.0.8.
Seems like the relevant check is:
https://github.com/beakerbrowser/homebase/blob/d872a66737f0874808f6e174419c98b1dc01ebc0/lib/webapi.js#L50
Something wrong with my request format? Seems like req.body.username blows up.
Code should probably check if req.body is a non-null object so that it gives a better error message. Not sure why your request is failing, maybe the content-type header is wrong?
Aha, I see, I'll try with the correct headers.
I'll leave this open to track better error messages.