loginEx

[ Function ]

public static loginEx(
    username: string | null | undefined,
    password: string | null | undefined,
    persistent: boolean = true,
    requestOptions: Server.IRequestOptions,
    callback?: (
        data: TcHmi.IResultObject
    ) => void
): boolean;

Logs in a new user. If this is successful, the client is reloaded.

Parameter

Name

Type

Description

username

string, null, undefined

User name

password

string, null, undefined

Password

persistent

boolean

Defines whether a session should survive a browser restart

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.

loginEx 1:

Available from version 1.10

Sample - JavaScript

TcHmi.Server.loginEx('Admin', 'sj5TzYkKExYgCcW', true, { timeout: 2000 }, function (data) {
    if (data.error === TcHmi.Errors.NONE) {
        // Success
    } else {
        // Error
    }
});