Skip to content

The second factor "uid" must be a valid non-empty string #1276

@flyingluscas

Description

@flyingluscas

Describe your environment

  • Operating System version: Arch Linux
  • Firebase SDK version: 9.5.0
  • Firebase Product: Auth
  • Node.js version: 14.15
  • NPM version: 6.14.11

Describe the problem

The admin.auth().updateUser function does not allow me to add a second factor to an existing user, always triggering the error The second factor "uid" must be a valid non-empty string., the function expects a valid uid but according to the docs it should not, if no uid is informed it should auto generate one. Can anyone help me understand if this is a bug in the lib or am I doing something wrong?

Steps to reproduce:

  1. Create a user without any secondary factors.
  2. Try to add a new secondary factor using the .updateUser function.

Relevant Code:

admin.auth().updateUser('123456789', {
  phoneNumber: '+16505550003',
  emailVerified: true,
  multiFactor: {
    enrolledFactors: [
      {
        phoneNumber: '+16505550003',
        displayName: 'Bender Bending Rodríguez',
        factorId: 'phone',
      },
    ],
  },
})

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions