Skip to content

Commit 9378563

Browse files
committed
Updated GIDTokenClaim Implementation + Tests with const string
1 parent 6ecc98e commit 9378563

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

GoogleSignIn/Sources/GIDTokenClaim.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDTokenClaim.h"
1818

19+
NSString * const kAuthTimeClaimName = @"auth_time";
20+
1921
// Private interface to declare the internal initializer
2022
@interface GIDTokenClaim ()
2123

@@ -39,11 +41,11 @@ - (instancetype)initWithName:(NSString *)name essential:(BOOL)essential {
3941
#pragma mark - Factory Methods
4042

4143
+ (instancetype)authTimeClaim {
42-
return [[self alloc] initWithName:@"auth_time" essential:NO];
44+
return [[self alloc] initWithName:kAuthTimeClaimName essential:NO];
4345
}
4446

4547
+ (instancetype)essentialAuthTimeClaim {
46-
return [[self alloc] initWithName:@"auth_time" essential:YES];
48+
return [[self alloc] initWithName:kAuthTimeClaimName essential:YES];
4749
}
4850

4951
#pragma mark - NSObject

GoogleSignIn/Sources/Public/GoogleSignIn/GIDTokenClaim.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
NS_ASSUME_NONNULL_BEGIN
2020

21+
extern NSString *const kAuthTimeClaimName;
22+
2123
/**
2224
* An object representing a single OIDC claim to be requested for an ID token.
2325
*/

GoogleSignIn/Tests/Unit/GIDTokenClaimTest.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#import <XCTest/XCTest.h>
1717
#import "GoogleSignIn/Sources/Public/GoogleSignIn/GIDTokenClaim.h"
1818

19-
static NSString *const kAuthTimeClaimName = @"auth_time";
20-
2119
@interface GIDTokenClaimTest : XCTestCase
2220
@end
2321

0 commit comments

Comments
 (0)