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
ciMagicciMagic 

How do I logout from Hybrid App

I want to logout of the Hybrid App and go back to the SF Login page.  How do I do that?  Thanks in advance.

ciMagicciMagic

Here is my method in the controller but it returns undefined.  I read somwhere it beacuse the headers is turn off.  Any help will be greatly appreciated.

 

public PageReference  logout(){
    PageReference newpage = new PageReference('/secur/logout.jsp');
    newpage.setRedirect(true);
    return newpage;
  }

Gaurav KheterpalGaurav Kheterpal

Add this to you inline.js file, I have tested it - works perfectly.

 

$('#link_logout').click(function() {
                            SalesforceOAuthPlugin.logout();
                            });

 

I hope this helps.

 

Regards,
Gaurav




ciMagicciMagic

Thanks Gaurav. but my app is served via Visualforce not index.html.