Closed Karalix closed 3 years ago
Hi,
If you want to use application/x-www-form-urlencoded
your request would need to look like this, which works for me with your setup:
curl --request POST \
--url http://localhost:3000/auth/register \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=joesmith@example.com' \
--data-urlencode 'password=bigsecret' \
--data-urlencode 'confirmPassword=bigsecret'
Or you can simply use application/json
instead:
curl --request POST \
--url http://localhost:3000/auth/register \
--header 'Content-Type: application/json' \
--data '{"email": "joesmith@example.com", "password": "bigsecret", "confirmPassword": "bigsecret"}'
Nevertheless, I should add some logs and return an error if the validation fails with anything else than an email being in use.
I works perfectly now and I feel pretty stupid for mixing urlencoded with my json object 😓
Would you welcome a pull request to make the Readme a bit more verbose/exhaustive around this part ?
No worries, thanks for reporting. There should have been a Validation Error as answer, not a 200: request processed
. The example part is a bit outdated anyway's, I'll update it together with my fix.
Hi ! I have been testing SuperLogin over the weekend for an upcoming project but it seems I have reached a blocking point.
I am trying to make the code example from the README work with my instance of CouchDB on my distant server.
The /register POST seems OK
but then there is nothing appearing in the Fauxton and of course the next step gives me some kind of error
And the CLI doesn't help me much as there is no error message at all, only
POST /auth/register 200 516.158 ms - 32
On the CouchDB logs, there is only this
POST /sl-users/_find 200 ok 5
when I perform the request.My SuperLogin config is as following :
Maybe you have an idea of what I did wrong ? Anyway thanks for maintaining this project.