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(
118
118
public actual val credential: AuthCredential ?
119
119
get() = rethrow { js.credential?.let { AuthCredential (it) } }
120
120
public actual val additionalUserInfo: AdditionalUserInfo ?
121
- get() = js.additionalUserInfo?.let { AdditionalUserInfo (it) }
121
+ get() = rethrow { js.additionalUserInfo?.let { AdditionalUserInfo (it) } }
122
122
}
123
123
124
124
public actual class AdditionalUserInfo (
@@ -129,7 +129,13 @@ public actual class AdditionalUserInfo(
129
129
public actual val username: String?
130
130
get() = js.username
131
131
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
+ }
133
139
public actual val isNewUser: Boolean
134
140
get() = js.newUser
135
141
}
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ public external interface AuthResult {
176
176
public external interface AdditionalUserInfo {
177
177
public val providerId: String?
178
178
public val username: String?
179
- public val profile: Map < String , Any ?> ?
179
+ public val profile: dynamic
180
180
public val newUser: Boolean
181
181
}
182
182
You can’t perform that action at this time.
0 commit comments