Validate User
To validate user's app session
Steps to validate user
- Create a ValidateUserRequest object using
ValidateUserRequest.builder()
class by passing all the required parameters. - Call
validateUser()
function using the instance ofLMFeedClient
. - Process the response LMResponse<ValidateUserResponse> as per your requirement.
// object of InitiateUserRequest
let request = ValidateUserRequest.builder()
.accessToken(accessToken)
.refreshToken(refreshToken)
.build()
LMFeedClient.shared.validateUser(request) { response in
// Response (LMResponse<ValidateUserResponse>)
if (response.success) {
// your function to process the response data
processResponse(response.data)
} else {
// your function to process error message
processError(response.errorMessage)
}
}
Models
ValidateUserRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
accessToken | String | The user's access token | Yes |
refreshToken | String | The user's refresh token | Yes |
ValidateUserResponse
Property | Type | Description | Optional |
---|---|---|---|
user | User | The validated user's information | ✔ |
appAccess | Bool | Whether the user has access to the app | ✔ |