Skip to content

Commit 59772b8

Browse files
authored
Merge pull request #2739 from brandonpage/user-agent-reload
Fix webview not reloading when User Agent Flow is used.
2 parents 29eb730 + 613ae89 commit 59772b8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

libs/SalesforceSDK/src/com/salesforce/androidsdk/ui/LoginViewModel.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ open class LoginViewModel(val bootConfig: BootConfig) : ViewModel() {
228228
/** Reloads the WebView with a newly generated authorization URL. */
229229
open fun reloadWebView() {
230230
if (!isUsingFrontDoorBridge) {
231+
// The Web Server Flow code challenge makes the authorization url unique each time,
232+
// which triggers recomposition. For User Agent Flow, change it to blank.
233+
if (!SalesforceSDKManager.getInstance().useWebServerAuthentication) {
234+
loginUrl.value = ABOUT_BLANK
235+
}
231236
loginUrl.value = getAuthorizationUrl(selectedServer.value ?: return)
232237
}
233238
}

0 commit comments

Comments
 (0)