Hello! π
My NestJS is always sending 200 as Http status code, even when failing (when invoking Supertokens endpoints). Is this the expected outcome?
r
rp_st
10/30/2022, 4:48 AM
Hey @iruizmar can you give me an example of when you are expecting it to return a non 200 and itβs returning a 200?
i
iruizmar
10/30/2022, 6:45 AM
Hey @rp_st! For example, on the OTP /consume method, if the OTP is invalid. Or if the deviceId/preAuthSessionId are wrong.
iruizmar
10/30/2022, 6:46 AM
I would expect some 400 there.
r
rp_st
10/30/2022, 6:48 AM
So we differentiate between expected and unexpected errors. A 400 would happen if the request body is of a different structure than what the api expects. Vs the request body is of the right structure, but semantically something is wrong (for example the OTP is invalid)
rp_st
10/30/2022, 6:48 AM
This is done so that developers are forced to handle states like invalid OTP explicitly
i
iruizmar
10/30/2022, 7:02 AM
Ok! That sounds indeed opinionated. Makes sense. Thanks π