aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firebase/Auth/Source/FIRUser.m
diff options
context:
space:
mode:
Diffstat (limited to 'Firebase/Auth/Source/FIRUser.m')
-rw-r--r--Firebase/Auth/Source/FIRUser.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/Firebase/Auth/Source/FIRUser.m b/Firebase/Auth/Source/FIRUser.m
index fc7930f..1b10976 100644
--- a/Firebase/Auth/Source/FIRUser.m
+++ b/Firebase/Auth/Source/FIRUser.m
@@ -251,6 +251,7 @@ static void callInMainThreadWithAuthDataResultAndError(
refreshToken:refreshToken];
FIRUser *user = [[self alloc] initWithTokenService:tokenService];
user.auth = auth;
+ user.requestConfiguration = auth.requestConfiguration;
[user internalGetTokenWithCallback:^(NSString *_Nullable accessToken, NSError *_Nullable error) {
if (error) {
callback(nil, error);
@@ -316,6 +317,8 @@ static void callInMainThreadWithAuthDataResultAndError(
[aDecoder decodeObjectOfClass:[FIRSecureTokenService class] forKey:kTokenServiceCodingKey];
FIRUserMetadata *metadata =
[aDecoder decodeObjectOfClass:[FIRUserMetadata class] forKey:kMetadataCodingKey];
+ NSString *APIKey =
+ [aDecoder decodeObjectOfClass:[FIRUserMetadata class] forKey:kAPIKeyCodingKey];
if (!userID || !tokenService) {
return nil;
}
@@ -334,6 +337,7 @@ static void callInMainThreadWithAuthDataResultAndError(
_providerData = providerData;
_phoneNumber = phoneNumber;
_metadata = metadata ?: [[FIRUserMetadata alloc] initWithCreationDate:nil lastSignInDate:nil];
+ _requestConfiguration = [[FIRAuthRequestConfiguration alloc] initWithAPIKey:APIKey];
}
return self;
}
@@ -349,8 +353,6 @@ static void callInMainThreadWithAuthDataResultAndError(
[aCoder encodeObject:_photoURL forKey:kPhotoURLCodingKey];
[aCoder encodeObject:_displayName forKey:kDisplayNameCodingKey];
[aCoder encodeObject:_metadata forKey:kMetadataCodingKey];
- // The API key is encoded even it is not used in decoding to be compatible with previous versions
- // of the library.
[aCoder encodeObject:_auth.requestConfiguration.APIKey forKey:kAPIKeyCodingKey];
[aCoder encodeObject:_tokenService forKey:kTokenServiceCodingKey];
}