i get a different error if the verify code is wron...
# javascript
k
i get a different error if the verify code is wrong or of the phone number is wrong/doesn't exist
g
Do you have a trigger function on auth.users?
Do you have a trigger function on auth.users?
k
yeah i have a db trigger on auth.user inserts
g
My guess is that is messing up. Look in database/postgres logs for an error
If it errors that will cause 500 error
k
yeah its a 500 error
but i dont get why?
im not inserting anything
and I'm not sure why that would prevent it (for what its worth, this seems to sometimes work, or at least the first login works)
man supabase has so many little gotchas that make no sense
g
So a new user works, but an existing one signing in with verifyOTP does not now? And your trigger function on auth.users is for insert only? I'll also note, my test was email OTP, so not exactly the same.
k
let me try and delete everything in my db and try from scratch
yeah I haven't tried email yet
for what its worth, it works to send the verification code on signin, but validating that verification code fails
g
Also make sure you have latest supabase-js if that is what you are using. There have been gotrue changes over the past 3 weeks.
k
yeah just updated and still getting it
there's like no info on what error 500 code is or what this status is haha
had this working too for the last few weeks and suddenly it stopped
g
So did you look in the database postgres log? I think that would show an error. 500 is just the http response error that the server (in this case postgres/database) had a fatal error of somesort.
k
yeah it doesn't show much in the logs thats useful
it has info about my machine sending it and thats about it
Copy code
{
  "headers": [
    {
      "cf_cache_status": "DYNAMIC",
      "cf_ray": "6fc0cc2c152c7e6b-LAX",
      "content_length": "92",
      "content_location": null,
      "content_range": null,
      "content_type": "application/json",
      "date": "Fri, 15 Apr 2022 01:09:45 GMT",
      "transfer_encoding": null,
      "x_kong_proxy_latency": "0",
      "x_kong_upstream_latency": "4.9999809265137"
    }
  ],
  "origin_time": 210,
  "status_code": 500
}
and this is the response
g
I guess it could be a gotrue server error. At this point you probably should contact support. If it is not your trigger function (which is insert, new user only) then really not sure what else to look at from outside.
k
ah wait I may remember something if I can remember what its called
I think i have an old trigger that wasn't working but i never deleted (it wasn't causing an issue before)
maybe that's messing things up
holy F#$%K that was it!
g
Sorry it took so long, but at least I feel good that my belief that 500 error on signin is almost always a trigger function. 😎
k
yeah forgot i had a second one in there, just dropping it seemed to fix the issue!