function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jim@SupportPayJim@SupportPay 

Hybrid-remote App Timing out to Salesforce Login Screen

Hybrid-remote App Timing out to Salesforce Login Screen

We are having a problem with a hybrid-remote app that is going to the Salesforce login screen instead of the app login screen after the session times out. We have a custom login page and in the controller uses Site.login. After the session times out the app goes to the Salesforce login instead of the custom app login. While at the Salesforce login page the Xcode log is in an authentication loop. Killing the app and relaunching and the user is automatically logged back into app.

If the user is logged in, when the session times out then they are incorrectly taken to a Salesforce login screen instead of being automatically re-logged in or taken to our login screen.

If they end up timed out and on the incorrect Salesforce login screen, they need to kill the app, reopen it, and only then they are correctly automatically re-logged in and taken to the Dashboard screen.

How can we get the timeout go to the correct app login screen?

———————————————

1. Version of Mobile SDK Used: 
5.0.1

2. Issue found in Native App or Hybrid App:
Hybrid-remote apps created using 'forceios create’ and 'forcedroid create'

3. OS Version:
iOS 10.3.1, 6.0.1, etc

4. Device:
iPhone 6s, Nexus, etc

5. Steps to reproduce:
Login to app, wait until session timeout, try to do anything. 

6. Actual behavior:
Taken to Salesforce login screen.

7. Expected Behavior:
Taken to custom login screen.

8. Error Log:
While at Salesforce login screen the Xcode log is in a loop.

———————————————

Side note: calling:
var sfOAuthPlugin = cordova.require("com.salesforce.plugin.oauth");
sfOAuthPlugin.logout();
takes the user back to the correct app login screen.

Another side note:
Getting OAuth erros screen:
5. Steps to reproduce:
Login to app, get the “Allow Access” screen, wait until session timeout, tap “Allow". 
6. Actual behavior:
Taken to OAuth Error screen.
7. Expected Behavior:
Taken back to custom app login screen.