supabase / supabase-js

An isomorphic Javascript client for Supabase. Query your Supabase database, subscribe to realtime events, upload and download files, browse typescript examples, invoke postgres functions via rpc, invoke supabase edge functions, query pgvector.
https://supabase.com
MIT License
2.83k stars 219 forks source link

New auth error codes missing in error object #1023

Open melchiorb opened 1 week ago

melchiorb commented 1 week ago

Bug report

Describe the bug

The new error code (which is correctly sent by the server) is not accessible in auth-js.

Example when using non existend email address on signin:

Server response: {"code":"otp_disabled","message":"Signups not allowed for otp"}

The error object returned by "supabase.auth.signInWithOtp": error.code = undefined error.message = "Signups not allowed for otp"

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Trigger auth error
  2. Inspect error object

Expected behavior

error.code = "otp_disabled"

System information