I have configured a Custom Menu on the header component on my Community(Napili template) using lightning:buttonMenu and had Logout as one of the menu items. Clicking on it, it would then redirect to a page(I call it as Logout screen).
if(selectedMenuItemValue == 'Logout'){
var urlEvent = $A.get("e.force:navigateToURL");
urlEvent.setParams({
"url": '/logout'
});
urlEvent.fire();
But how can I actually implement a Logout that happens from Standard Logout item from Community's default Profile Header?
<lightning:menuItem>
under<lightning:buttonMenu>
. I couldn't use a<a href>
tag as its not working with buttonMenu tag. Is there any other work around? Thanks