You need to sign in to do that
Don't have an account?
Carter Mellor
Recognise a community user on a force.com site
Is there a way to recognise a logged in community user on a force.com site? By recognise, I mean if a visualforce page or apex controller were to call a {!$User.FirstName} variable or something similar.
From what I can see, it looks like the site forces the everyone into the Guest user.
From what I can see, it looks like the site forces the everyone into the Guest user.
For Apex, something like: Or using VF to display the current user license: Reference;
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_userlicense.htm
Regards
Andrew
Sorry but that doesn't work. The UserInfo.getUserId() and {!$User.Id} are just getting the Guest User information. I want the user to be considered logged in, so I can get their Id with those calls.
In your first post you said that it was a "logged in community user", so i figured the above would work. But I just re-read you comment about everything seeming to be passed to Guest user. I might configure a test env with community and do some testing.
Apologies for not reading correctly and messing your question.
Regards
Andrew