firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Not disable emulator authentication edit user.

Open nitaking opened this issue 2 years ago • 1 comments

[REQUIRED] Environment info

firebase-tools: 11.4

Platform: macOS

[REQUIRED] Test case

After run firebase emulators:start, Edit Authentication Edit User If then not enable SAVE button.

[REQUIRED] Steps to reproduce

  1. use v11 firebase-tools
  2. firebase emulators:start
  3. Goto Authentication
  4. Goto Edit User
  5. Press Save button

[REQUIRED] Expected behavior

Enable Save.

Can work for v10.8.0 and v10.9.0. Currently, using this version to this issue. (Screenshot is from v10.)

CleanShot 2022-08-02 at 20 33 39@2x

[REQUIRED] Actual behavior

Disable Save.

nitaking avatar Aug 02 '22 11:08 nitaking

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

google-oss-bot avatar Aug 02 '22 11:08 google-oss-bot

The latest emulator does not consider the form to be valid until the user has a password, even though it is valid for a user to not have a password via a range of login methods.

Eg:

image

KoryNunn avatar Aug 30 '22 04:08 KoryNunn

Hey @nitaking, thanks for filing this issue, this is working as intended. Digging into this a bit more: To clarify, saving a user with an email but without a password is an invalid state. In earlier versions of Firebase Emulator UI, e.g. firebase-tools v10.8 or v10.9, this invalid state would display an error message when you would first add that user.

v10 8-add

However, for editing a user, the "Save" button was enabled when it wouldn't necessarily do anything. The following is a recording of what would happen on v10.8 if you edited a user that had email+password and tried to remove the password. Notice that even if you tried to save the user without the password, it would still be present if you inspected the user again.

https://user-images.githubusercontent.com/14339917/191853893-ea1f0cf8-2e8d-41a3-b303-6df3971b5983.mov

The newer versions, e.g. v11.4 and later, disables the "Save" button to prevent states that shouldn't be saved, such as saving an email/password user without the password, which is what you're encountering.

https://user-images.githubusercontent.com/14339917/191854098-11f6a6a7-3314-4c98-ad9d-a5508ef74500.mov

lisajian avatar Sep 22 '22 21:09 lisajian

@KoryNunn, thanks for the follow up - this is also working as intended. You can still add users without either email/password or phone number. However, to do so, you would have to call one of the SDK methods to create the user or one of the emulated endpoints. You would not be able to create those users through the Emulator UI, though; this is similar to how you may be able to create new email/password users in the Firebase Console, but not anonymous users.

As an example, the following is a screenshot of a new auth user that was created from calling signInAnonymously from a test app and then inspecting the Emulator UI:

v11 9-anon

lisajian avatar Sep 22 '22 21:09 lisajian

I'm going to close out this issue, but if you have any questions, please feel free to follow up on this thread or open a new issue if it's separate from this discussion

lisajian avatar Sep 22 '22 21:09 lisajian

Should we not still be able to edit claims, display names, etc. without then having to provide password/auth details (this follow-up question specifically targets email-link sign-up/in) in order to click save within the emulator UI?

ChrisBoik avatar Nov 12 '23 19:11 ChrisBoik