Skip to main content

Validate User

The validateUser method is an asynchronous function responsible for validating a user based on the provided ValidateUser request object.

Steps to validate a User

  1. To validate a user, use the method validateUser() provided by the lmChatClient you created.
  2. Pass the required refreshToken and accessToken to the function.
  3. Use the response as per your requirement
const payload: any = {
refreshToken: "ENTER_REFRESH_TOKEN",
accessToken: "ENTER_ACCESS_TOKEN",
};
const response = await lmChatClient?.validateUser(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Validate User Payload

List of parameters provided by validateUser()

VariableTypeDescription
refreshTokenstringRefresh token for the session
accessTokenstringAccess token for the session

Validate User Response

List of parameters for the response

VariableTypeDescription
communityCommunityCommunity object
accessTokenstringAccess token for authentication
refreshTokenstringRefresh token for authentication
userUserUser object
appAccessbooleanIndicates if the app access is granted
hasAnswersbooleanIndicates if the user has provided answers
logoutResponseLMResponse<Nothing>Response object for logout action