Logout
To disconnect a user (say that you’re for instance logging out and logging in as someone new) you can call the logout()
method.
Steps to logout User
- Use the
logout()
function provided by thelmFeedClient
object created earlier. - Create an instance of
LogoutRequest
, as shown in the snippet and pass it to the above method. - Use the response as per your requirement
try {
const logoutRequest = LogoutRequest.builder()
.setRefreshToken("<ENTER_REFRESH_TOKEN>") // refresh token of the user
.setDeviceId("<ENTER_DEVICE_ID>") // unique id of the device
.build();
const response = await lmFeedClient.logout(logoutRequest);
// Use the response as per your requirement.
} catch (error) {
// Use the error as per your requirement.
}
Models
LogoutRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
refreshToken | string | Refresh token of the user. | |
deviceId | string | Unique id of the device. |