this.userId in Methods not Working in Server Calls

Hi, I have defined a method in which only this.userId value is returned.
And I called this method on the server, and it returned the null method, which means no user has logged in.
Whereas, when I call this method in the client, it returns the user’s ID.
What does this really mean ??

this is my code in Server StartUp :

	GetCurrentUser (){
	    return this.userId;
});'GetCurrentUser',(er ,re)=>{
1 Like

If you call this method from the server there shouldn’t be any value for this.userid as the call is not associated or originating from a particular user.

I have used this pattern before to check if the server made the call or a client.