Get logged in customer ActionFilter

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I have action filter

public class CustomerActionFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            base.OnActionExecuted(filterContext);


which fires when the Customer controller login (post) completes. This work well enough but I'm unsure how to get the now logged in user. I've tried inheriting the IAuthenticationService but this returns a null as does the httpcontext user.

Is there a way of getting the logged in user (assuming the login is successful)?
7 years ago
Always use WorkContext.CurrentCustomer to get the current customer, logged in or not. ;)
7 years ago
wooncherk wrote:
Always use WorkContext.CurrentCustomer to get the current customer, logged in or not. ;)


Thank you for the pointer, it's allowed me to progress to the next stage of retrieve the customers last name.

Much appreciated.
7 years ago
Great it helped! :)
6 years ago
WorkContext.CurrentCustomer is returning the previous Customer before loging, the guest account. How can I solve this to get the real customer that has login right now.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.