Newer Version Available
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})