cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Hybrid App - How do I implement logout functionality?

former_member239819
Participant

I've applied the following logout functionality to my SAPUI5 Hybrid/Cordova app.

onLogout: function () {

   if (typeof sap.hybrid !== 'undefined') {
      sap.Logon.core.deleteRegistration(this.logonUnregisterSuccessCallback(), this.errorCallback());
   }
},

logonUnregisterSuccessCallback: function (){
      sap.Logon.core.loadStartPage();
}

deleteRegistration() works, but loadStartPage() takes me straight back into the app without forcing me to login again.

I need to force the login to give the user a method to switch usernames.

former_member239819
Participant
0 Kudos

Further to the above...

Is there a specific logout function rather than a de-register?

0 Kudos

Hello Adam Harkus,

How could you achieve that because even I also struck at the same point.

Thanks In Advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

kevin_xu4
Active Participant
0 Kudos

Following code can be used for logout functionally in fiori based Hybrid mobile applications , after successful execution of this method , navigate the screen to login page.

sap.Logon.core.deleteRegistration(jQuery.proxy(
	this.onDeleteRegistrationSuccess, this), jQuery.proxy(
	this.onLogonError, this));

Thanks