prkng / api

REST API powering Prkng apps and Web services
MIT License
10 stars 8 forks source link

LoginRegister returns 404 status code for duplicate #4

Closed mudar closed 8 years ago

mudar commented 8 years ago

When signing up with POST /v1/login/register for a second time using the same email, the call returns 404 User already exists

We could replace this by a 409 Conflict status code http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10

@antonino-u I guess this would create legacy issues on iOS? If that's the case, we should probably wait for v2

The current android version checks for both 404 and 409 codes

peakwinter commented 8 years ago

IIRC the iOS client should just fail on anything that's not a 200 (or 201), but will check!

mudar commented 8 years ago

The idea is that clients could rely on the status code to display accurate messages.

If it's 409, I can tell the user that he's already registered, and should try to reset his password. But if it's 501 (example), then I would say server error and the user would know that the problem is on our side, not his fault = less frustration!