firebase / firebase/firebase-tools

updateProfile doesn't accept displayName null or photoURL null

Open
#6,424 5 comments 0 reactions 1 assignee Claimed by @pragatimodi View on GitHub
api: auth emulators: auth reproducible
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Operating System

macOS

### Browser Version

Safari 16.5.2

### Firebase SDK Version

10.3.0

### Firebase SDK Product:

Auth

### Describe your project's tooling

index.html with source tag.

### Describe the problem

[updateProfile](https://firebase.google.com/docs/reference/js/auth.md#updateprofile)'s signature indicates that `displayName` and `photoURL` both can accept `null`, but they can't, because if you pass `null` to either of them you get `FirebaseError: Firebase: Error (auth/invalid-json-payload-received.-/displayname-must-be-string).` or
`FirebaseError: Firebase: Error (auth/invalid-json-payload-received.-/photourl-must-be-string).` respectively.

### Steps and code to reproduce issue

Assuming you already have a `user1@test.com` with `123456` password

```
var result = await signInWithEmailAndPassword(auth, "user1@test.com", "123456");
var user = result.user;
await updateProfile(user, { displayName: null, photoURL: null });
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.