Skip to content

Commit 1f3d15b

Browse files
author
Swasti Gupta
committed
Resolved comments
1 parent 8dfec63 commit 1f3d15b

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

MSAL/src/MSALPublicClientApplication.m

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ - (instancetype)initWithConfiguration:(MSALPublicClientApplicationConfig *)confi
193193
{
194194
*error = [MSALErrorConverter msalErrorFromMsidError:msidError];
195195
}
196+
196197
return nil;
197198
}
198199
}
@@ -898,15 +899,23 @@ - (void)updateExternalAccountsWithResult:(MSALResult *)result context:(id<MSIDRe
898899

899900
- (BOOL)isAADNonConsumerTenant:(MSALAuthority *)authority
900901
{
901-
if (![authority isKindOfClass:[MSALAADAuthority class]]) return NO;
902+
// Ensure the authority is of type MSALAADAuthority
903+
if (![authority isKindOfClass:[MSALAADAuthority class]]) {
904+
return NO;
905+
}
902906

903907
MSIDAuthority *msidAuthority = ((MSALAADAuthority *)authority).msidAuthority;
904-
if (![msidAuthority isKindOfClass:[MSIDAADAuthority class]]) return NO;
905908

906-
MSIDAADAuthority *aadMsidAuthority = (MSIDAADAuthority *)msidAuthority;
907-
MSIDAADTenant *tenant = aadMsidAuthority.tenant;
909+
// Ensure the underlying MSID authority is of type MSIDAADAuthority
910+
if (![msidAuthority isKindOfClass:[MSIDAADAuthority class]]) {
911+
return NO;
912+
}
913+
914+
MSIDAADAuthority *aadAuthority = (MSIDAADAuthority *)msidAuthority;
915+
MSIDAADTenant *tenant = aadAuthority.tenant;
908916

909-
return (tenant && tenant.type != MSIDAADTenantTypeConsumers);
917+
// Return YES if the tenant exists and is not of type 'Consumers'
918+
return (tenant != nil && tenant.type != MSIDAADTenantTypeConsumers);
910919
}
911920

912921
- (void)acquireTokenWithParameters:(MSALInteractiveTokenParameters *)parameters

MSAL/src/util/MSALRedirectUri.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ + (BOOL)redirectUriIsBrokerCapable:(NSURL *)redirectUri
6969
error:(NSError * __autoreleasing *)error
7070
{
7171
MSIDRedirectUriValidationResult validationResult = [MSIDRedirectUri redirectUriIsBrokerCapable:redirectUri
72-
error:error];
72+
error:error];
7373
return validationResult == MSIDRedirectUriValidationResultMatched;
7474
}
7575

0 commit comments

Comments
 (0)