https://supertokens.com/ logo
500 error issue
p

PoktBlade

05/17/2023, 4:43 AM
Hi, I get error 500 when calling
signInAndUp
but after subsequent calls (maybe or two), I will get success. Is this common behavior for third party login?. I just wrapped logic in for loop to fix. But if anyone knows why that would be better
r

rp

05/17/2023, 4:52 AM
Hey @PoktBlade do you have an error stack trace? This is not common
r

rp

05/17/2023, 4:53 AM
@sattvikc can help here.
s

sattvikc

05/17/2023, 4:59 AM
@PoktBlade what is the response message of the 500? could you also share request body ?
p

PoktBlade

05/17/2023, 5:17 AM
If I experience again I'll show
Provider API returned response with status
401 Unauthorized
and body
{"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}
is the error. But I figured it out. It's due to React strict mode in development. It makes more calls then it should
double renders, one fails, one doesn't
r

rp

05/17/2023, 5:28 AM
cool! yea, that sounds about right
this only happens in dev builds though
p

PoktBlade

05/17/2023, 5:30 AM
Yeah this was happening in development. I think potentially the failure was happening sooner then the success, but then i have code to redirect to login if it happens. The for loop solution works for development though but not ideal
r

rp

05/17/2023, 5:33 AM
yeaa. fair