Skip to content

Commit a3ecd94

Browse files
authored
prevent accidental removal of photo URL (#100)
1 parent 91c10d0 commit a3ecd94

File tree

2 files changed

+2
-2
lines changed
  • firebase-auth/src
    • androidMain/kotlin/dev/gitlive/firebase/auth
    • commonMain/kotlin/dev/gitlive/firebase/auth

2 files changed

+2
-2
lines changed

firebase-auth/src/androidMain/kotlin/dev/gitlive/firebase/auth/user.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ actual class FirebaseUser internal constructor(val android: com.google.firebase.
4848
actual suspend fun updateProfile(displayName: String?, photoUrl: String?) {
4949
val request = UserProfileChangeRequest.Builder()
5050
.setDisplayName(displayName)
51-
.setPhotoUri(photoURL?.let { Uri.parse(it) })
51+
.setPhotoUri(photoUrl?.let { Uri.parse(it) })
5252
.build()
5353
android.updateProfile(request).await()
5454
}

firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/user.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ expect class FirebaseUser {
2727
suspend fun updateEmail(email: String)
2828
suspend fun updatePassword(password: String)
2929
suspend fun updatePhoneNumber(credential: PhoneAuthCredential)
30-
suspend fun updateProfile(displayName: String? = null, photoUrl: String? = null)
30+
suspend fun updateProfile(displayName: String? = this.displayName, photoUrl: String? = this.photoURL)
3131
suspend fun verifyBeforeUpdateEmail(newEmail: String, actionCodeSettings: ActionCodeSettings? = null)
3232
}
3333

0 commit comments

Comments
 (0)