forcedotcom / forcedotcom/SalesforceMobileSDK-iOS

App logs out existing user when switching accounts on the same device

Open
#4,104 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Objective-C
Stars
553
Forks
425
Avg merge
18h 6m
Merged PRs (30d)
37

Description

When a user switches to another account on the same device, the app remains open and functioning. However, if the app closes unexpectedly and is then reopened from the background, the previously logged-in user is logged out.

Steps to Reproduce:

Log in to the app with User A on a device.

Log out and log in as User B on the same device.

Keep the app open and continue using it.

Force the app to close.

Reopen the app.

User B has logged out automatically

Expected Result:
The app should preserve the active session for the currently logged-in user and not log them out unexpectedly.

Actual Result:
After reopening the app, the previously logged-in user is logged out.

This issue is only present in the iOS SDK, but on Android there are no issues; it works as expected

SDK 13.1.0
React Native Version 79.3
react: 19.0.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue on iOS with SDK 13.1.0 and React Native 79.3 by switching from User A to User B, force-closing the app, and reopening it. Compare the iOS behavior with Android, then trace how the active session is restored after relaunch. Done means User B remains logged in after the app is reopened.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, objective-c, react-native
Domain
authentication, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.