You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When authorization via a single-server, custom tab activity is requested skip fetching the authorization configuration and immediately set the selected login server to generate the OAuth authorization URL.
// Load the authorization URL in a browser custom tab if required and do nothing otherwise as the view model will load it in the web view.
1157
+
if ((viewModel.singleServerCustomTabActivity || sdkManager.isBrowserLoginEnabled) &&!viewModel.isUsingFrontDoorBridge /* UI front-door bridge bypasses the need for browser custom tab */) {
val trimmedServer = newServer.url.run { trim { it <='' } }
216
219
if (pendingServer.value == trimmedServer) {
217
-
reloadWebView()// TODO: Review the need for this and its use prior to fetching the authentication configuration. ECJ20251201
220
+
reloadWebView()
218
221
} else {
219
222
pendingServer.value = trimmedServer
220
223
}
@@ -223,11 +226,18 @@ open class LoginViewModel(val bootConfig: BootConfig) : ViewModel() {
223
226
// Update loginUrl when selectedServer updates so webview automatically reloads
224
227
loginUrl.addSource(selectedServer) { newServer ->
225
228
val isNewServer = loginUrl.value?.startsWith(newServer) !=true
226
-
// Note the web view does not reload when browser-based authentication or a UI Bridge API front door bridge URL are active.
227
-
if (isNewServer &&!SalesforceSDKManager.getInstance().isBrowserLoginEnabled &&!isUsingFrontDoorBridge) {
229
+
if (isNewServer) {
228
230
loginUrl.value = getAuthorizationUrl(newServer)
229
231
}
230
232
}
233
+
234
+
// Update the web view URL to match the OAuth authorization URL when the web view is applicable
235
+
webViewUrl.addSource(loginUrl) { newLoginUrl ->
236
+
// Note the web view does not reload when browser-based authentication or a UI Bridge API front door bridge URL are active.
237
+
if ((!SalesforceSDKManager.getInstance().isBrowserLoginEnabled &&!isUsingFrontDoorBridge) || newLoginUrl =="about:blank"/* Blank is used during reset states such as when returning to the web view from a custom tab, so it's always eligible */) {
238
+
webViewUrl.value = newLoginUrl
239
+
}
240
+
}
231
241
}
232
242
233
243
/** Reloads the WebView with a newly generated authorization URL. */
0 commit comments