So from what I can tell, when a user attempts to r...
# contributing
So from what I can tell, when a user attempts to reset their password with an invalid token, SuperTokens returns an object with
. If the developer is keeping track of these kinds of error strings as "enums", he/she can respond to this pretty easily by observing
. 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
checks on
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
property? Maybe
? Or, I guess technically it could have the same status as with an invalid token... since tokens aren't allowed to be undefined. 🤔
Hey the api expects “some” token an input.
So if you don’t provide a token, you get back a 400 error response.
Versus if you provide an invalid token, it gives that type of response with the status
Technically, yea. We could make a missing token return that as well.. but I dont imagine it being too difficult to just pass an empty string if the token isn’t preset at all.
Mkay. So
Copy code
const { token = "", ...etc } = formData;
Yeah that's fair enough. Thanks!