Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a customer that wants an adminbar to appear on their webpage if they are logged into the backend. I am trying to do this from an UmbracoViewPage, and after some googling, I've found the two following solutions, however they don't seem to work:
bool isLoggedIn = UmbracoContext.Security.IsAuthenticated();
This always returns false.
bool isLoggedIn = UmbracoContext.Security.CurrentUser != null;
CurrrentUser is always null.
Any help would be appreciated!
I found the solution:
HttpContextBase wrapper = new HttpContextWrapper(HttpContext.Current);
UmbracoBackOfficeIdentity user = wrapper.GetCurrentIdentity(true);
bool isLoggedIn = user != null;
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted