File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
android/uk/co/reallysmall/cordova/plugin/firebase/ui/auth Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -460,13 +460,13 @@ private JSONObject formatUser(FirebaseUser user) {
460
460
461
461
try {
462
462
463
- anonymous = false ;
463
+ anonymous = user . isAnonymous () ;
464
464
465
465
resultData .put ("name" , user .getDisplayName ());
466
466
resultData .put ("email" , user .getEmail ());
467
467
resultData .put ("emailVerified" , user .isEmailVerified ());
468
468
resultData .put ("id" , user .getUid ());
469
- if (user .getMetadata ().getCreationTimestamp () == user .getMetadata ().getLastSignInTimestamp ()) {
469
+ if (anonymous == false && user .getMetadata ().getCreationTimestamp () == user .getMetadata ().getLastSignInTimestamp ()) {
470
470
resultData .put ("newUser" , true );
471
471
} else {
472
472
resultData .put ("newUser" , false );
Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ - (NSDictionary *)formatUser:(FIRUser *)user {
357
357
358
358
NSNumber *newUser;
359
359
360
- self.anonymous = false ;
360
+ self.anonymous = [user isAnonymous ] ;
361
361
362
362
if ([user isEmailVerified ]) {
363
363
isEmailVerified = @YES ;
@@ -370,7 +370,7 @@ - (NSDictionary *)formatUser:(FIRUser *)user {
370
370
NSDate *lastSignInDate = [metadata lastSignInDate ];
371
371
NSDate *creationDate = [metadata creationDate ];
372
372
373
- if ([lastSignInDate compare: creationDate] == NSOrderedSame) {
373
+ if (!self. anonymous && [lastSignInDate compare: creationDate] == NSOrderedSame) {
374
374
newUser = @YES ;
375
375
} else {
376
376
newUser = @NO ;
You can’t perform that action at this time.
0 commit comments