codeuino / social-platform-donut-backend

Donut API:
http://donut-api-prod.codeuino.org/
GNU General Public License v3.0
24 stars 57 forks source link

Creating a new user return an invalid response. #53

Closed AuraOfDivinity closed 4 years ago

AuraOfDivinity commented 4 years ago

Describe the bug Creating a user by making a post request to the /user route returns an object containing an "error" property. Even though this gives the false sense that we might have run into an error while creating a user, the user actually happens to be created in the backend. (Check the screenshot below.)

Expected behavior A correct response with a message such as "User successfully created" along with some details(i.e the document id) of the newly created user should be sent along in the response.

Screenshots ErrorResponse

Additional context I'd be working on this issue.

AuraOfDivinity commented 4 years ago

This was caused by not having a secret set in the jwt.sign() method. Closing as it was caused by an error on my part. Apologies for any inconvenience caused.