-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Labels
bugSomething isn't workingSomething isn't workingtriageIssues that need to be triagedIssues that need to be triaged
Description
Currently, GIDGoogleUser provides EMM error handling support by checking with itself if EMM support is provided (i.e., self.emmSupport). This call will notably occur before self.fetcherAuthorizer = authorization in the initializer.
The problem is that the implementation of -[GIDGoogleUser emmSupport] uses self.authState to determine EMM support. self.authState unfortunately, references fetcherAuthorizer.
Therefore, since GIDGoogleUser checks for EMM support prior to fetcherAuthorizer being set, it will always return nil when being checked.
- (OIDAuthState *) authState{
return ((GTMAppAuthFetcherAuthorization *)self.fetcherAuthorizer).authState;
}
- (nullable NSString *)emmSupport {
return self.authState.lastAuthorizationResponse
.request.additionalParameters[kEMMSupportParameterName];
}
- (instancetype)initWithAuthState:(OIDAuthState *)authState
profileData:(nullable GIDProfileData *)profileData {
self = [super init];
if (self) {
_tokenRefreshHandlerQueue = [[NSMutableArray alloc] init];
_profile = profileData;
#if TARGET_OS_IOS && !TARGET_OS_MACCATALYST
GTMAppAuthFetcherAuthorization *authorization = self.emmSupport ?
[[GIDAppAuthFetcherAuthorizationWithEMMSupport alloc] initWithAuthState:authState] :
[[GTMAppAuthFetcherAuthorization alloc] initWithAuthState:authState];
#elif TARGET_OS_OSX || TARGET_OS_MACCATALYST
GTMAppAuthFetcherAuthorization *authorization =
[[GTMAppAuthFetcherAuthorization alloc] initWithAuthState:authState];
#endif // TARGET_OS_IOS && !TARGET_OS_MACCATALYST
authorization.tokenRefreshDelegate = self;
authorization.authState.stateChangeDelegate = self;
self.fetcherAuthorizer = authorization;
[self updateTokensWithAuthState:authState];
}
return self;
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageIssues that need to be triagedIssues that need to be triaged