Skip to content

Commit 56ea45f

Browse files
authored
Fixes nullability and removed redundant property for FIROAuthCredential. (#262)
* Fixes nullability and removed redundant property for FIROAuthCredential. * Fixes a typo in FIROAuthCredential initializer.
1 parent 446c5c0 commit 56ea45f

File tree

3 files changed

+15
-21
lines changed

3 files changed

+15
-21
lines changed

Firebase/Auth/Source/AuthProviders/OAuth/FIROAuthCredential.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,25 @@ NS_ASSUME_NONNULL_BEGIN
2525
*/
2626
@interface FIROAuthCredential : FIRAuthCredential
2727

28-
/** @property providerID
29-
@brief The provider ID associated with this credential.
30-
*/
31-
@property(nonatomic, readonly) NSString *providerID;
32-
3328
/** @property IDToken
3429
@brief The ID Token associated with this credential.
3530
*/
36-
@property(nonatomic, readonly) NSString *IDToken;
31+
@property(nonatomic, readonly, nullable) NSString *IDToken;
3732

3833
/** @property accessToken
3934
@brief The access token associated with this credential.
4035
*/
41-
@property(nonatomic, readonly) NSString *accessToken;
36+
@property(nonatomic, readonly, nullable) NSString *accessToken;
4237

4338
/** @fn initWithProviderId:IDToken:accessToken:
4439
@brief Designated initializer.
4540
@param providerID The provider ID associated with the credential being created.
4641
@param IDToken The ID Token associated with the credential being created.
4742
@param accessToken The access token associated with the credential being created.
4843
*/
49-
- (nullable instancetype)initWithProvierID:(NSString *)providerID
50-
IDToken:(nullable NSString*)IDToken
51-
accessToken:(nullable NSString *)accessToken;
44+
- (nullable instancetype)initWithProviderID:(NSString *)providerID
45+
IDToken:(nullable NSString*)IDToken
46+
accessToken:(nullable NSString *)accessToken;
5247

5348
@end
5449

Firebase/Auth/Source/AuthProviders/OAuth/FIROAuthCredential.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#import "FIROAuthCredential.h"
18-
#import "FIRAuthExceptionUtils.h"
18+
1919
#import "FIRVerifyAssertionRequest.h"
2020

2121
NS_ASSUME_NONNULL_BEGIN
@@ -28,12 +28,11 @@ - (nullable instancetype)initWithProvider:(NSString *)provider NS_UNAVAILABLE;
2828

2929
@implementation FIROAuthCredential
3030

31-
- (nullable instancetype)initWithProvierID:(NSString *)providerID
32-
IDToken:(nullable NSString *)IDToken
33-
accessToken:(nullable NSString *)accessToken {
31+
- (nullable instancetype)initWithProviderID:(NSString *)providerID
32+
IDToken:(nullable NSString *)IDToken
33+
accessToken:(nullable NSString *)accessToken {
3434
self = [super initWithProvider:providerID];
3535
if (self) {
36-
_providerID = providerID;
3736
_IDToken = IDToken;
3837
_accessToken = accessToken;
3938
}

Firebase/Auth/Source/AuthProviders/OAuth/FIROAuthProvider.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ @implementation FIROAuthProvider
2525
+ (FIRAuthCredential *)credentialWithProviderID:(NSString *)providerID
2626
IDToken:(NSString *)IDToken
2727
accessToken:(nullable NSString *)accessToken {
28-
return [[FIROAuthCredential alloc] initWithProvierID:providerID
29-
IDToken:IDToken
30-
accessToken:accessToken];
28+
return [[FIROAuthCredential alloc] initWithProviderID:providerID
29+
IDToken:IDToken
30+
accessToken:accessToken];
3131
}
3232

3333
+ (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
3434
accessToken:(NSString *)accessToken {
35-
return [[FIROAuthCredential alloc] initWithProvierID:providerID
36-
IDToken:nil
37-
accessToken:accessToken];
35+
return [[FIROAuthCredential alloc] initWithProviderID:providerID
36+
IDToken:nil
37+
accessToken:accessToken];
3838
}
3939

4040
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)