We have a customer community with a custom Visualforce application and a custom login page, so that when you are logged into community you are always in the VF app.
I have created a Url Rewriter class for the community Site. I need to detect whether there is a currently logged-in user or not and redirect accordingly. The redirects are to VF pages within the app.
However, I've found that the context user in the Url Rewriter is always the site guest user, even when I'm logged in to the community. I'm debugging UserInfo.getUserId()
in the class, and as I navigate through the VF application, the rewriter debug always shows the guest user.
That is strange because we use UserInfo
methods in the VF application itself and they always return the logged-in user.
Salesforce premier support says this is working as designed. Has anyone come up with a good workaround for this?