What is the correct HTTP status code that should be returned by a REST service when:
The HTTP 201 Created success status response code indicates that the request has succeeded and has led to the creation of a resource.
First, create a password recovery email, which includes a link (and recovery token) specific to this end user. Then, the end user can follow the link to a web page in Epicenter where they can reset their password. Alternatively, you can also use the Password API with this recovery token to update the password directly.
TLDR;
There is no built-in way of doing this. You will have to rely on home-made status codes and conventions.
I don't think that there is a built-in HTTP status code for a such thing.
All you can really do here is to return a 200 OK
response and add in the content of the response body a message/code telling the user that they need to change their password. If they don't, the next time they attempt to login with the single-use password they should get a 401 unauthorized
(and you can return in the body of the 401
a message telling them to change their password because they attempted to use an expired single-use password).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With