Get Current Logged User

Muhammad Abdullah asked on May 19, 2025 14:11

In the class library template project that is used to add custom modules to the Admin dashboard, I added the module, it appears in the admin dashboard and it works very well.

Now, in this class library I have added controllers that handle my business logic and it works very well when calling any APIs within these controllers.

What is the problem ? the problem is that, I have an API within a controller to fetch Info of current logged user using this Code => var user = MembershipContext.AuthenticatedUser; it always fetch a user with ID = 65 which has a username = "public" , but I was looged in with a user administrator how to get the logged user not the public one ?

   Please, sign in to be able to submit a new answer.