0

Is there any way to get the logged user information inside a lightning component? The lightning component displays an Iframe and I want

1
  • 1
    What you have tried so far? Can edit your question with those details as well? – sanket kumar Jun 18 '19 at 3:27
1

Seems that this is available in both Aura and LWC.

https://jayakrishnasfdc.wordpress.com/2019/01/13/get-current-user-id-information-in-lightning-web-components/

In Aura:

var userId = $A.get("$SObjectType.CurrentUser.Id");

In LWC:

import userId from '@salesforce/user/Id';

Then, because you have userId, you can use LDS or your custom Apex code to get the data about the User object.

Not the answer you're looking for? Browse other questions tagged or ask your own question.