Redirect Callback Bug

Hi, I am using linkSocial and want to handle any errors on my custom page rather than on the default api error page. I discovered that in the parseState errorURL is being set in case it's not in the state object. This leads to the error url of redirectOnError always being this default error url see here. I could create a PR to fix this, but I am not quite familiar whether this would introduce new unwanted behaviours. --- TLDR: The onAPIError errorURL is being overwritten by parseState
1 Reply
Sebastian
SebastianOP2w ago
I checked the usage of parseState seems like the issue persists on more pages. I created a draft pr: https://github.com/better-auth/better-auth/pull/2780 Duplicate of: https://github.com/better-auth/better-auth/pull/2640
GitHub
Use custom errorURL when available by ErikPetersenDev · Pull Reque...
This PR resolves: #2519 Summary There are a few places in the code where the custom errorURL is not checked/used, resulting in the default Better Auth error page. This PR copies the way this is do...

Did you find this page helpful?