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 | User name | |
password | Password | |
persistent | Defines whether a session should survive a browser restart | |
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.10 |
Sample - JavaScript
TcHmi.Server.loginEx('Admin', 'sj5TzYkKExYgCcW', true, { timeout: 2000 }, function (data) {
if (data.error === TcHmi.Errors.NONE) {
// Success
} else {
// Error
}
});