Skip to content

firebase SDK v9 update current user fail #5753

@freefony

Description

@freefony

Describe your environment

  • Operating System version: MacOS 11.2.3
  • Browser version: Chrome, Version 95.0.4638.69 (Official Build) (x86_64)
  • Firebase SDK version: 9.4.1
  • Firebase Product: auth

I am using SDK v9 and having issues with updating user profiles fails with

TypeError: user._clone is not a function
    at AuthImpl.updateCurrentUser (auth_impl.ts:309)
    at updateUser (firebase.service.ts:41)
    at Object.signUp (firebase.service.ts:31)
    at async handlesubmit (index.tsx:32)

here in the firebase SDK

async updateCurrentUser(userExtern: User | null): Promise<void> {
    // The public updateCurrentUser method needs to make a copy of the user,
    // and also check that the project matches
    const user = userExtern
      ? (getModularInstance(userExtern) as UserInternal)
      : null;
    if (user) {
      _assert(
        user.auth.config.apiKey === this.config.apiKey,
        this,
        AuthErrorCode.INVALID_AUTH
      );
    }
    return this._updateCurrentUser(user && user._clone(this));
  }

Firebase User does not have any _clone property and if it is supposed be on UserInternal, doesn't seem to be working.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions