auth
auth copied to clipboard
Handle 400 error from supabase.co/auth/v1/callback with a redirect to an error page
Bug report
- [x] I confirm this is a bug with Supabase, not with my own application.
- [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When signing in with social Auth, for example Azure it seems that the callback has a timeout and if the users waits to long to login the callback fails with {"code":400,"msg":"OAuth state is invalid: token is expired by ..."}
This breaks the flow and it is a very bad UX.
In my opinion the supabase callback should redirect with some timeout error in order for the application to handle this, for example tell the user to retry the flow.
To Reproduce
Steps to reproduce the behaviour, please provide code snippets or a repository:
- go to https://supabase-vercel-integration.vercel.app/
- Click on sign in with Google
- When on the sign in Google page, go make a coffee(wait 10 min to be sure)
- Come back
- Finish the sing in
- get the 400 error shown in JSON
Expected behaviour
FEATURE REQUEST: Redirect to an app url with a timeout error
System information
- OS: MacOs
- Browser : Chrome
- Version of supabase-js: ^2.22.0
- Version of Node.js: v18.16.0