SAPUI5 Logout Event with Javascript

3.6k views Asked by At

I am currently working on a SAP XS application. Using the provided API, I want to log off my user on the website. Im totally new on Javascript to please dont mind the probable ease of my question.

The API (https://sapui5.hana.ondemand.com/sdk/docs/api/symbols/sap.ui.commons.ApplicationHeader.html#event:logoff) provides the method "fireLogoff". But before that I have to add "attachLogoff" to the applicationheader in my application right?

My faulty method looks like this:

oAppHeader.attachLogoff(function logout(oEvent) {this.fireLogOff();});

Thank you a lot for helping a noob in this matter.

1

There are 1 answers

2
Nikolay Nadorichev On

fireLogOff calls a function assigned to logOff. So you need to write your own code for SAP HANA API that makes user to log off. Or you can just close browser tab:

oAppHeader.attachLogoff(function(){window.close();});