File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
firebase-auth/src/jsMain/kotlin/dev/gitlive/firebase/auth Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public actual class AuthResult(
118118 public actual val credential: AuthCredential ?
119119 get() = rethrow { js.credential?.let { AuthCredential (it) } }
120120 public actual val additionalUserInfo: AdditionalUserInfo ?
121- get() = js.additionalUserInfo?.let { AdditionalUserInfo (it) }
121+ get() = rethrow { js.additionalUserInfo?.let { AdditionalUserInfo (it) } }
122122}
123123
124124public actual class AdditionalUserInfo (
@@ -129,7 +129,13 @@ public actual class AdditionalUserInfo(
129129 public actual val username: String?
130130 get() = js.username
131131 public actual val profile: Map <String , Any ?>?
132- get() = js.profile
132+ get() = rethrow {
133+ val profile = js.profile ? : return @rethrow null
134+ val entries = js(" Object.entries" ) as (dynamic ) -> Array <Array <Any ?>>
135+ return @rethrow entries
136+ .invoke(profile)
137+ .associate { entry -> entry[0 ] as String to entry[1 ] }
138+ }
133139 public actual val isNewUser: Boolean
134140 get() = js.newUser
135141}
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ public external interface AuthResult {
176176public external interface AdditionalUserInfo {
177177 public val providerId: String?
178178 public val username: String?
179- public val profile: Map < String , Any ?> ?
179+ public val profile: dynamic
180180 public val newUser: Boolean
181181}
182182
You can’t perform that action at this time.
0 commit comments