Newer Version Available

This content describes an older version of this product. View Latest

logout for Lightning Experience

Logs an agent out of Omni-Channel.

Arguments

Name Type Description
callback function JavaScript method to call when the agent is logged out of Omni-Channel.

Sample Code

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:omniToolkitAPI aura:id="omniToolkit" />
3    <lightning:button label="Logout" onclick="{! c.logout }" />
4</aura:component>

Controller code:

1({
2    logout: function(cmp, evt, hlp) {
3        var omniAPI = cmp.find("omniToolkit");
4        omniAPI.logout({
5            callback: function(result) {
6                if (result.success) {
7                    console.log("Logout successful");
8                } else {
9                    console.log("Logout failed");
10                }
11            }
12        });
13    }
14})

Response

This method is asynchronous so it returns its response in an object in a callback method. The response object contains the following properties:

Name Type Description
success boolean true if the logout was successful; false otherwise.