@nuralogix.ai/dfx-api-client / HTTP / Auths

Auths

Auths end points

These endpoints provide user/device authentication.

Sample code

const apiClient = client();
const data = {
    Token: 'your-old-token'
    RefreshToken: 'your-old-refresh-token'
};

const response = await apiClient.http.auths.renew(data);
const { status, body } = response;
if (status !== '200') {
    /**
     * TypeScript knows that once we are inside this block, the only response
     * shape that matches a non "200" response is the ErrorResponse
    */
    throw body;
}
/** Otherwise the shape of the response is RenewToken200Response */
console.log(body.RefreshToken);

Methods

renew

renew(data)

Renew user/device access and refresh token. When you register a license or login with user's credentials, a pair of Token and RefreshToken is sent to a client. The client needs to send the matching pair to exchange it with a new pair. The old pair will not be valid after calling this endpoint. RefreshToken is one-time use.

Endpoint Action ID = 2304

Parameters

NameType
dataAuthRenewTokenRequest

Returns

Promise<ErrorResponse | AuthRenewToken200Response>


requestLoginCode

requestLoginCode(data)

Request to send login code.

Endpoint Action ID = 2303

Parameters

NameType
dataAuthLoginCodeRequest

Returns

Promise<ErrorResponse | AuthLoginCodeSent200Response>


requestResetPasswordLink

requestResetPasswordLink(data)

Request to send password reset link to user's email.

Endpoint Action ID = 2300

Parameters

NameType
dataAuthResetPasswordLinkRequest

Returns

Promise<ErrorResponse | AuthResetPasswordLink200Response>