Error codes are not strings?

I was trying to compare the error code returned from the authClient, but when I print the value of the enum it just prints Proxy so the switch fails. See screenshots
No description
No description
5 Replies
bekacru
bekacru2mo ago
Are you on latest version of Better Auth?
Christian (N0_L0gic)
I'm on v1.2.4
Christian (N0_L0gic)
Assume that's the latest?
No description
bekacru
bekacru5w ago
I thought we made error codes work in runtime as well but I just checked the docs and we only mention on how to use them to infer types. For now use how the guide suggests how to handle error code, but we'll fix this soon. https://www.better-auth.com/docs/concepts/client#error-codes
Client | Better Auth
Better Auth client library for authentication.
Christian (N0_L0gic)
Yeah this is what I did for now
No description

Did you find this page helpful?