ITEnthusiasm
10/21/2022, 5:27 PM{ status: RESET_PASSWORD_INVALID_TOKEN_ERROR }
. If the developer is keeping track of these kinds of error strings as "enums", he/she can respond to this pretty easily by observing data.status
.
However, if the user requests a password reset without a token, the returned error object is different and instead looks like: { message: 'Please provide the password reset token' }
.
This discrepancy makes it a bit difficult for developers to have a unified approach to responding to errors. (For instance, I usually do if/then
checks on data.status
to know how to go about returning error messages to the frontend in a response.)
Is there any chance that missing token error objects could also be given an error status
property? Maybe RESET_PASSWORD_MISSING_TOKEN_ERROR
? Or, I guess technically it could have the same status as with an invalid token... since tokens aren't allowed to be undefined. 🤔rp
10/21/2022, 5:29 PMITEnthusiasm
10/21/2022, 5:31 PMts
const { token = "", ...etc } = formData;
then.