Logout User
To disconnect a user (say that you’re for instance logging out and logging in as someone new) you can call the logout()
method present in LMChatClient
class.
Logging out
- For an user to logout, use the
logout()
method of the client you initialised. - Pass in the
refreshToken
which is a required parameter. - Process the response as per your requirement.
const payload: any = {
refreshToken: 'aajhsdhsadhjsa';
};
const response = await lmChatClient.logout(payload);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Logout User Payload
List of parameters supported.
Variable | Type | Description | Optional |
---|---|---|---|
refreshToken | string | refreshToken of user logged in |
Logout User Response
List of parameters in the response.
Variable | Type | Description |
---|---|---|
success | boolean | API success status |
error_message | string | Error message in case of failure |