loginEx2
[ Function ]
public static loginEx2(
userName: string | null | undefined,
password: string | null | undefined,
persistent: boolean = true,
reload: boolean = false,
requestOptions: TcHmi.Server.IRequestOptions | null,
callback?: null | (
(data: TcHmi.IResultObject) => void
) = null
): boolean;
Logs in a new user. If this is successful, the client is optionally reloaded.
Parameter
Name | Type | Description |
---|---|---|
userName | User name to log in | |
password | Password to log in | |
persistent | Defines whether a session should survive a browser restart. | |
reload | Specifies whether the client should be restarted. | |
requestOptions | Options | |
callback [ optional ] | (data: TcHmi.IResultObject) => void | Asynchronous callback function that is triggered when the operation was terminated. |
Return value
Type | Description |
---|---|
Returns confirmation as to whether the operation was successfully sent. |
Available from version 1.12 |
Sample - JavaScript
TcHmi.Server.loginEx2('Admin', 'sj5TzYkKExYgCcW', false, true, { timeout: 2000 }, function(data) {
if (data.error === TcHmi.Errors.NONE) {
// Success
} else {
// Error
}
});