Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

Hi Developer Trailblazers! 

 

Three questions: 

1) When someone logs in as an Experience user it is logged in the Setup Audit Trail.  Is there a way to have an audience that can detect that an "impersonation" is being used?  I would like an Experience page to know that a "Log in as" has been used to add some different content from when a person logs in with username and pw. 

 

2) We are turning off the Header in the community this gets rid of the Profile dropdown including logout. I don't see a way to show the User Profile component other than in the header.  Is it possible?   

 

3) Again with Log in to Experience as user, to log out I have tried to create a component with a Logout button, but it is not working to return the user to standard SF page? Could some one help with this?

1 answer
  1. Feb 12, 11:18 PM

    I tried https://developer.salesforce.com/docs/atlas.en-us.exp_cloud_lwr.meta/exp_cloud_lwr/advanced_custom_logout.htm

    , but that wasn't working. 

     

    I also tried the code below, which does log out of the community, but doesn't navigate back to Salesforce "agent view"

    async logout() {

    // Logout

    console.log('about to get url...');

    const logoutUrl = await getLogoutUrl();

    console.log('url: ' + logoutUrl);

    await fetch(logoutUrl);

    console.log('about to navigate...');

    // Login page (or could navigate to some other URL)

    this[NavigationMixin.Navigate]({

    type: 'standard__webPage',

    attributes: { url: 'https://workforcesoftware--staging.sandbox.lightning.force.com/' }

    });

    }

0/9000