Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code for "invalid login credentials" missing #947

Closed
2 tasks done
haydn opened this issue Jul 24, 2024 · 3 comments
Closed
2 tasks done

Error code for "invalid login credentials" missing #947

haydn opened this issue Jul 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@haydn
Copy link

haydn commented Jul 24, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

As documented, all auth errors are meant to come through with an error code:

Errors originating from the server API classed as AuthApiError always have a code property that can be used to identify the error returned by the server.

However, this doesn't appear to be the case with "invalid login credentials" errors:

{
  data: { user: null, session: null },
  error: AuthApiError: Invalid login credentials
      « stack trace » {
    __isAuthError: true,
    status: 400,
    code: undefined
  }
}

To Reproduce

  1. Execute supabase.auth.signInWithPassword({ email, password }) with invalid credentials.

Expected behavior

There should be an error code in the AuthApiError object, instead of undefined.

Screenshots

N/A

System information

  • OS: macOS
  • supabase-js: 2.44.3
  • Node.js: 20.15.0
  • GoTrue: 2.155.3

Additional context

@haydn haydn added the bug Something isn't working label Jul 24, 2024
@J0 J0 transferred this issue from supabase/supabase-js Aug 27, 2024
@J0
Copy link
Contributor

J0 commented Aug 27, 2024

Hi folks,

Thanks for reporting the issue - there should be a code now and it should look something like:
image

Going to close but let us know if it still shows up for you

@J0 J0 closed this as completed Aug 27, 2024
@J0
Copy link
Contributor

J0 commented Aug 27, 2024

On further investigation it seems like this is present on the platform. Re-opening

@J0 J0 reopened this Aug 27, 2024
@J0
Copy link
Contributor

J0 commented Aug 27, 2024

Ah right the version is not deployed yet - here's the fix: supabase/auth#1721

It should go out later in the week. Closing again

@J0 J0 closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants