Skip to content

Commit

Permalink
fix(auth): Fixed bug that sets email to nil on iOS when the `User…
Browse files Browse the repository at this point in the history
…` has no provider. (#8209)
  • Loading branch information
russellwheatley committed Mar 8, 2022
1 parent 9976d9d commit fb64643
Showing 1 changed file with 0 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1252,12 +1252,6 @@ + (NSMutableDictionary *)getNSDictionaryFromUser:(FIRUser *)user {
NSMutableDictionary *userData = [[self getNSDictionaryFromUserInfo:user] mutableCopy];
NSMutableDictionary *metadata = [NSMutableDictionary dictionary];

// This code is necessary to avoid an iOS issue where when unlinking the `password` provider
// the previous email still remains on the currentUser.
if ([user.providerData count] == 0) {
userData[@"email"] = [NSNull null];
}

// metadata.creationTimestamp as milliseconds
long creationDate = (long)([user.metadata.creationDate timeIntervalSince1970] * 1000);
metadata[@"creationTime"] = @(creationDate);
Expand Down

0 comments on commit fb64643

Please sign in to comment.