Skip to content

Commit f4615f1

Browse files
brandonpagewmathurin
authored andcommitted
Merge pull request #2718 from brandonpage/fix-current-user
Switch to new user before sending user switch intent.
1 parent 17171ff commit f4615f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/SalesforceSDK/src/com/salesforce/androidsdk/auth/AuthenticationUtilities.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ internal suspend fun onAuthFlowComplete(
201201

202202
// Save the user account
203203
addAccount(account)
204+
userAccountManager.createAccount(account)
205+
userAccountManager.switchToUser(account)
204206

205207
// Init user logging
206208
SalesforceAnalyticsManager.getInstance(account)?.updateLoggingPrefs()
@@ -218,8 +220,6 @@ internal suspend fun onAuthFlowComplete(
218220
else -> USER_SWITCH_TYPE_DEFAULT
219221
}
220222
userAccountManager.sendUserSwitchIntent(userSwitchType, null)
221-
userAccountManager.createAccount(account)
222-
userAccountManager.switchToUser(account)
223223

224224
// Kickoff the end of the flow before storing mobile policy to prevent launching
225225
// the main activity over/after the screen lock.

0 commit comments

Comments
 (0)