@@ -348,21 +348,20 @@ class FirebaseAuth constructor(val app: FirebaseApp) : InternalAuthProvider {
348
348
349
349
@Throws(IOException ::class )
350
350
override fun onResponse (call : Call , response : Response ) {
351
- response.body().use { body ->
352
- if (! response.isSuccessful) {
353
- signOutAndThrowInvalidUserException(body?.string().orEmpty(), " token API returned an error: ${body?.string()} " )
354
- } else {
355
- jsonParser.parseToJsonElement(body!! .string()).jsonObject.apply {
356
- val user = FirebaseUserImpl (app, this , user.isAnonymous)
357
- if (user.claims[" aud" ] != app.options.projectId) {
358
- signOutAndThrowInvalidUserException(
359
- user.claims.toString(),
360
- " Project ID's do not match ${user.claims[" aud" ]} != ${app.options.projectId} "
361
- )
362
- } else {
363
- this @FirebaseAuth.user = user
364
- source.setResult(user)
365
- }
351
+ val body = response.body()?.use { it.string() }
352
+ if (! response.isSuccessful) {
353
+ signOutAndThrowInvalidUserException(body.orEmpty(), " token API returned an error: $body " )
354
+ } else {
355
+ jsonParser.parseToJsonElement(body!! ).jsonObject.apply {
356
+ val user = FirebaseUserImpl (app, this , user.isAnonymous)
357
+ if (user.claims[" aud" ] != app.options.projectId) {
358
+ signOutAndThrowInvalidUserException(
359
+ user.claims.toString(),
360
+ " Project ID's do not match ${user.claims[" aud" ]} != ${app.options.projectId} "
361
+ )
362
+ } else {
363
+ this @FirebaseAuth.user = user
364
+ source.setResult(user)
366
365
}
367
366
}
368
367
}
0 commit comments