An empty reference that will be populated with the actual data once the response is returned
from the server.

(The remote method definition does not provide any description.
This usually means the response is a `User` object.)

User.getCachedCurrent

Get data of the currently logged user that was returned by the last
call to User.login or
User.getCurrent. Return null when there
is no user logged in or the data of the current user were not fetched
yet.

Returns

Name

Type

Description

result

Object

A User instance.

User.getCurrent(successCb, errorCb)

Get data of the currently logged user. Fail with HTTP result 401
when there is no user logged in.

Arguments

Name

Type

Description

successCb

function(Object, Object)

Success callback with two arguments: value, responseHeaders.

errorCb

function(Object)

Error callback with one argument: httpResponse.

Returns

Name

Type

Description

result

Object

An empty reference that will be populated with the actual data once the response is returned
from the server.

User.getCurrentId

Returns

Name

Type

Description

result

Object

Id of the currently logged-in user or null.

User.isAuthenticated

Returns

Name

Type

Description

result

boolean

True if the current user is authenticated (logged in).

User.login(parameters, postData, successCb, errorCb)

Login a user with username/email and password

Arguments

Name

Type

Description

parameters

Object

Request parameters.

include – {string=} - Related objects to include in the response. See the description of return value for more details.
Default value: user.