I'm trying to get currently logged in user type in the community, but I'm facing some issues. I have published my community and that published link is not working properly

Scenario 1.Open incognito browser 2.login to salesforce org 3.Directly access published community URL

---> server side controller returns logged in user as Guest user

4.Now search all communities in quick find, click on community URL beside community name 5.Refresh the published URL

--->server side controller returns logged in user as Standard user

I'm trying to get proper behaviour of a community after login in salesforce org, any suggestions on this. I'll shear my server-side code here

public static String getUserType(){

    return UserInfo.getUserType();

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.