auth-js
auth-js copied to clipboard
feat: support throwing errors instead of returning them
Fixes #1020
Add support for throwOnError option in AuthClient to throw errors instead of returning them.
-
GoTrueClient Changes:
- Add
throwOnErroroption toGoTrueClientconstructor. - Modify methods to throw errors when
throwOnErroris true. - Update methods like
signUp,signInWithPassword,updateUser, and others to throw errors ifthrowOnErroris true.
- Add
-
AuthClient Changes:
- Update
AuthClientto passthrowOnErroroption toGoTrueClient.
- Update
-
Tests:
- Add tests in
test/GoTrueClient.test.tsto verifythrowOnErrorfunctionality.
- Add tests in
For more details, open the Copilot Workspace session.
Don't worry about the check-conventional-commits errors, I'll fix those before merging.
moved: https://github.com/supabase/supabase-js/pull/1766