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) {
460460
461461 try {
462462
463- anonymous = false ;
463+ anonymous = user . isAnonymous () ;
464464
465465 resultData .put ("name" , user .getDisplayName ());
466466 resultData .put ("email" , user .getEmail ());
467467 resultData .put ("emailVerified" , user .isEmailVerified ());
468468 resultData .put ("id" , user .getUid ());
469- if (user .getMetadata ().getCreationTimestamp () == user .getMetadata ().getLastSignInTimestamp ()) {
469+ if (anonymous == false && user .getMetadata ().getCreationTimestamp () == user .getMetadata ().getLastSignInTimestamp ()) {
470470 resultData .put ("newUser" , true );
471471 } else {
472472 resultData .put ("newUser" , false );
Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ - (NSDictionary *)formatUser:(FIRUser *)user {
357357
358358 NSNumber *newUser;
359359
360- self.anonymous = false ;
360+ self.anonymous = [user isAnonymous ] ;
361361
362362 if ([user isEmailVerified ]) {
363363 isEmailVerified = @YES ;
@@ -370,7 +370,7 @@ - (NSDictionary *)formatUser:(FIRUser *)user {
370370 NSDate *lastSignInDate = [metadata lastSignInDate ];
371371 NSDate *creationDate = [metadata creationDate ];
372372
373- if ([lastSignInDate compare: creationDate] == NSOrderedSame) {
373+ if (!self. anonymous && [lastSignInDate compare: creationDate] == NSOrderedSame) {
374374 newUser = @YES ;
375375 } else {
376376 newUser = @NO ;
You can’t perform that action at this time.
0 commit comments