Refresh User
To keep the user session active and ensure uninterrupted access to the LikeMinds Feed, you can refresh the user's authentication tokens using the refreshUser()
function.
Steps to Refresh User Session
Build a
RefreshRequest
object using theRefreshRequestBuilder
class.Call the
refreshUser()
function using the instance of theLMFeedClient
class.Use the response as per your requirement.
// Provide refresh token for renewing the user session
String refreshToken = "refresh_token_here";
// Build the request object
RefreshRequest refreshRequest = (RefreshRequestBuilder()..refreshToken(refreshToken)).build();
// Get the response from calling the function
final RefreshResponse response = await lmFeedClient.refreshUser(refreshRequest);
// Process the response, as per requirement
if(response.success){
// your function to process refreshed user session
processRefreshedUserSession(response);
}else{
// your function to process error message
processError(response.errorMessage);
}
tip
Refreshing a user session ensures continuous access to the LikeMinds Feed without requiring the user to log in again.
Models
RefreshRequest
List of parameters for the RefreshRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
refreshToken | String | Refresh token for authentication | ✔ |
RefreshResponse
List of parameters for the RefreshResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in case of failure | ✔ |
accessToken | String | Access token for authentication | ✔ |
refreshToken | String | Refresh token for authentication | ✔ |