1
votes

How would I realize the logoff function in Shell control having this API example: https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.ui.commons.ApplicationHeader.html#event:logoff

    var oLogoff = new sap.ui.commons.ApplicationHeader();

    ... // within the Shell (function logout)
    logout : function(oEvent) {
        oLogoff.fireLogoff(); // this.fireLogoff() also not working
    },
    ...

EDIT:
oShell.fireLogout();
--> seems to be right, but this Ends up in an error "Not enough stack Memory" .. anybody any help?

I expect returning to a Login-page ... is this handled automatically?

2

2 Answers

3
votes

Use the shells Container logout-method:

sap.ushell.Container.logout();
1
votes

The logout function of the Shell control is only an event you can use to trigger your own logout function when someone clicks the logout button in the Shell header (see here).

oShell.fireLogout() ends up in a stack overflow as you´re calling your own function again and again.

The logout itself is not done for you automatically. Depending on your deployment scenario the logout implementation differs as the session management is done differently.