Skip to content

Commit 4d22add

Browse files
committed
fix(SalesforceSDKCore): gate host list back button on forced-advanced-auth flag
shouldShowBackButton returned YES for any host list VC whenever the config's shouldDisplayBackButton was true, without checking showsBackButtonAndLoginOptions. shouldDisplayBackButton is !appConfig.shouldAuthenticate, which is YES in environments without a bootconfig, so the back button leaked onto instances outside the forced-advanced-auth path. Add the showsBackButtonAndLoginOptions guard already used on the sole production caller (line 159) and the login-options gear (line 275) so the method is self-consistent. Fixes the failing unit test test_givenUnlockedNoFlowNoAccount_whenShouldShowBackButton_thenNo.
1 parent 0d464f7 commit 4d22add

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

libs/SalesforceSDKCore/SalesforceSDKCore/Classes/Login/LoginHost/SFSDKLoginHostListViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ - (BOOL)shouldShowBackButton {
226226
}
227227

228228
SFUserAccountManager *accountManager = [SFUserAccountManager sharedInstance];
229-
if ([self.config isKindOfClass:[SFSDKLoginViewControllerConfig class]]
229+
if (self.showsBackButtonAndLoginOptions
230+
&& [self.config isKindOfClass:[SFSDKLoginViewControllerConfig class]]
230231
&& ((SFSDKLoginViewControllerConfig *)self.config).shouldDisplayBackButton) {
231232
return YES;
232233
}

0 commit comments

Comments
 (0)