getCurrentUser

[ Function ]

public static getCurrentUser(): string | null;

Returns the name of the current user as string or null.

Parameter

Name

Type

Description

-

-

-

Return value

Type

Description

string, null

The name of the currently logged on user or null in the event of an error or if no user is logged on.

getCurrentUser 1:

Available from 1.8

Sample - JavaScript

var user = TcHmi.Server.getCurrentUser();
if(user) {
    console.log('Current user is ' + user);
} else {
    console.log('We have no current user.');
}