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

Cannot clear user phone number using `supabase.auth.admin.updateUserById` function #1008

Open bombillazo opened 3 weeks ago

bombillazo commented 3 weeks ago

Bug report

Describe the bug

Using the supabase.auth.admin.updateUserById and passing phone as an empty string, I would expect the phone value to be set to blank, passing null also give an API error

To Reproduce

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

  1. Setup your supabase client with admin priviledges
  2. call the supabase.auth.admin.updateUserById:
    await supabase.auth.admin.updateUserById(
    userId,
    {  phone: '' }, // or  {  phone: null }
    );

Expected behavior

Phone is successfully cleard.

System information

Additional context

Add any other context about the problem here.