Request a password reset code
const url = 'https://api.emite.cr/v1/auth/forgot-password';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"ventas@emite.cr"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.emite.cr/v1/auth/forgot-password \ --header 'Content-Type: application/json' \ --data '{ "email": "ventas@emite.cr" }'Starts the password recovery: when the email belongs to an EmiteCR account, sends it a 6-digit code, valid for 15 minutes, for POST /v1/auth/reset-password. Answers 202 at once, whether or not the email belongs to an account, so neither the response nor its timing reveals which ones exist: the code is created and emailed after the answer. Per account, at most one code every 60 seconds: a request within that window sends nothing (the code already sent still works) and answers 202 too.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Email of the account. The reset code is sent only when it belongs to an EmiteCR account, and the 202 answer is the same either way.
Example
ventas@emite.crResponses
Section titled “Responses”Accepted; the same answer whether or not the email has an account.
object
The email the request named, echoed back. The answer is the same whether or not it belongs to an account, so it reveals nothing; when it does, the 6-digit reset code went there.
Example
{ "email": "ventas@emite.cr"}