Skip to content

Fixes nullability and removed redundant property for FIROAuthCredential. #262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Firebase/Auth/Source/AuthProviders/OAuth/FIROAuthCredential.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,25 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface FIROAuthCredential : FIRAuthCredential

/** @property providerID
@brief The provider ID associated with this credential.
*/
@property(nonatomic, readonly) NSString *providerID;

/** @property IDToken
@brief The ID Token associated with this credential.
*/
@property(nonatomic, readonly) NSString *IDToken;
@property(nonatomic, readonly, nullable) NSString *IDToken;

/** @property accessToken
@brief The access token associated with this credential.
*/
@property(nonatomic, readonly) NSString *accessToken;
@property(nonatomic, readonly, nullable) NSString *accessToken;

/** @fn initWithProviderId:IDToken:accessToken:
@brief Designated initializer.
@param providerID The provider ID associated with the credential being created.
@param IDToken The ID Token associated with the credential being created.
@param accessToken The access token associated with the credential being created.
*/
- (nullable instancetype)initWithProvierID:(NSString *)providerID
IDToken:(nullable NSString*)IDToken
accessToken:(nullable NSString *)accessToken;
- (nullable instancetype)initWithProviderID:(NSString *)providerID
IDToken:(nullable NSString*)IDToken
accessToken:(nullable NSString *)accessToken;

@end

Expand Down
9 changes: 4 additions & 5 deletions Firebase/Auth/Source/AuthProviders/OAuth/FIROAuthCredential.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#import "FIROAuthCredential.h"
#import "FIRAuthExceptionUtils.h"

#import "FIRVerifyAssertionRequest.h"

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

@implementation FIROAuthCredential

- (nullable instancetype)initWithProvierID:(NSString *)providerID
IDToken:(nullable NSString *)IDToken
accessToken:(nullable NSString *)accessToken {
- (nullable instancetype)initWithProviderID:(NSString *)providerID
IDToken:(nullable NSString *)IDToken
accessToken:(nullable NSString *)accessToken {
self = [super initWithProvider:providerID];
if (self) {
_providerID = providerID;
_IDToken = IDToken;
_accessToken = accessToken;
}
Expand Down
12 changes: 6 additions & 6 deletions Firebase/Auth/Source/AuthProviders/OAuth/FIROAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ @implementation FIROAuthProvider
+ (FIRAuthCredential *)credentialWithProviderID:(NSString *)providerID
IDToken:(NSString *)IDToken
accessToken:(nullable NSString *)accessToken {
return [[FIROAuthCredential alloc] initWithProvierID:providerID
IDToken:IDToken
accessToken:accessToken];
return [[FIROAuthCredential alloc] initWithProviderID:providerID
IDToken:IDToken
accessToken:accessToken];
}

+ (FIROAuthCredential *)credentialWithProviderID:(NSString *)providerID
accessToken:(NSString *)accessToken {
return [[FIROAuthCredential alloc] initWithProvierID:providerID
IDToken:nil
accessToken:accessToken];
return [[FIROAuthCredential alloc] initWithProviderID:providerID
IDToken:nil
accessToken:accessToken];
}

NS_ASSUME_NONNULL_END
Expand Down