supabase: Authentication error messages poorly/not documented
Improve documentation
Link
Could potentially go in multiple places, e.g. just for email/password login auth docs or client docs.
Describe the problem
The potential return values of most of the auth functions are not documented, which makes it hard to handle potential errors client-side.
Describe the improvement
Include details of the potential messages the auth functions can return.
Could alternatively link to the gotrue docs if you wish to maintain a separation, however they would also need to be improved first as they currently list the only possible response as 200 success
Additional context
After manually working up through the dependancy tree to try and document the potential errors for the supabase-js signInWithPassword function figure out how to handle them in my project, i came up with the following list (links are to the part of the code that returns the error):
- ‘You must provide either an email or phone number and a password’ (comes from gotrue-js all others from gotrue)
- ‘Email logins are disabled’
- ‘Database error querying schema’
- ‘Email not confirmed’
- ‘Failed to set JWT cookie’
- ‘Invalid login credentials’ - shown when
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 14
- Comments: 16 (9 by maintainers)
Hi @dshukertjr Interesting.
AuthSessionMissingExceptioncould be thrown for other reasons. Anyway, if we go by this assumption, it will be difficult to differentiate between what is a bug and what is not. The error code adoption should be consistent for all APIs.Hey @LukeHosk, thanks for pointing this out! The team is aware of this and are working on standardizing error messages. It might make most sense to wait for the standardization to be completed before documenting