Skip to main content

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

  1. Build a RefreshRequest object using the RefreshRequestBuilder class.

  2. Call the refreshUser() function using the instance of the LMFeedClient class.

  3. 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

VariableTypeDescriptionOptional
refreshTokenStringRefresh token for authentication

RefreshResponse

List of parameters for the RefreshResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure
accessTokenStringAccess token for authentication
refreshTokenStringRefresh token for authentication