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

string, null, undefined

User name to log in

password

string, null, undefined

Password to log in

persistent

boolean

Defines whether a session should survive a browser restart.

reload

boolean

Specifies whether the client should be restarted.

requestOptions

Server.IRequestOptions

Options

callback [ optional ]

(data: TcHmi.IResultObject) => void

Asynchronous callback function that is triggered when the operation was terminated.

Return value

Type

Description

boolean

Returns confirmation as to whether the operation was successfully sent.

loginEx2 1:

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
    }
});