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

Unable to delete user if encrypted_password is set to null #1543

Open
2 tasks done
thedalelakes opened this issue Apr 18, 2024 · 1 comment
Open
2 tasks done

Unable to delete user if encrypted_password is set to null #1543

thedalelakes opened this issue Apr 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@thedalelakes
Copy link

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

A user can be created with encrypted_password set to null. However, if you attempt to delete that user, it results in a 500 error.

To Reproduce

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

INSERT INTO auth.users (
        instance_id,
        id,
        aud,
        role,
        email,
        encrypted_password,
        email_confirmed_at,
        invited_at,
        confirmation_token,
        confirmation_sent_at,
        recovery_token,
        recovery_sent_at,
        email_change_token_new,
        email_change,
        email_change_sent_at,
        last_sign_in_at,
        raw_app_meta_data,
        raw_user_meta_data,
        is_super_admin,
        created_at,
        updated_at,
        phone,
        phone_confirmed_at,
        phone_change,
        phone_change_token,
        phone_change_sent_at,
        email_change_token_current,
        email_change_confirm_status    
    ) VALUES (
        '00000000-0000-0000-0000-000000000000', /* instance_id */
        '1234567890', /* id */
        'authenticated', /* aud character varying(255),*/
        'authenticated', /* role character varying(255),*/
        null, /* email character varying(255),*/
        /*
         *
         * THE FOLLOWING LINE IS THE ISSUE
         *
        */
        null, /* encrypted_password character varying(255),*/
        null, /* email_confirmed_at timestamp with time zone,*/
        '2023-11-02T07:17:58.000Z', /* invited_at timestamp with time zone, */
        '', /* confirmation_token character varying(255), */
        null, /* confirmation_sent_at timestamp with time zone, */
        '', /* recovery_token character varying(255), */
        null, /* recovery_sent_at timestamp with time zone, */
        '', /* email_change_token_new character varying(255), */
        '', /* email_change character varying(255), */
        null, /* email_change_sent_at timestamp with time zone, */
        null, /* last_sign_in_at timestamp with time zone, */
        '{"provider": "phone","providers":["phone"]}', /* raw_app_meta_data jsonb,*/
        '{"fbuser":{"uid":"0019726b-bc97-586b-bb29-5624cb1529ec","emailVerified":false,"phoneNumber":"+15555550000","disabled":false,"metadata":{"lastSignInTime":"Thu, 02 Nov 2023 07:18:00 GMT","creationTime":"Thu, 02 Nov 2023 07:17:58 GMT"},"tokensValidAfterTime":"Thu, 02 Nov 2023 07:17:58 GMT","providerData":[{"uid":"+15555550000","providerId":"phone","phoneNumber":"+15555550000"}]}}', /* raw_user_meta_data jsonb,*/
        false, /* is_super_admin boolean, */
        NOW(), /* created_at timestamp with time zone, */
        NOW(), /* updated_at timestamp with time zone, */
        '+15555550000', /* phone character varying(15) DEFAULT NULL::character varying, */
        NOW(), /* phone_confirmed_at timestamp with time zone, */
        '', /* phone_change character varying(15) DEFAULT ''::character varying, */
        '', /* phone_change_token character varying(255) DEFAULT ''::character varying, */
        null, /* phone_change_sent_at timestamp with time zone, */
        '', /* email_change_token_current character varying(255) DEFAULT ''::character varying, */
        0 /*email_change_confirm_status smallint DEFAULT 0 */   
    ) ON CONFLICT DO NOTHING;

Expected behavior

User can be deleted, either via the Dashboard or programatically.

Screenshots

Screenshot 2024-04-17 at 7 10 16 PM ## System information

N/A

Additional context

N/A

@thedalelakes thedalelakes added the bug Something isn't working label Apr 18, 2024
@thedalelakes
Copy link
Author

listUsers via Supabase JS Admin API also fails w/ the same 500 error if the user w/ a NULL encrypted_password is in the page.

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

1 participant