logout

There is no network request made from this call. We simply clear all the cached user tokens and this prevents calls to any of the protected endpoints, logging out the user.

logout() : Call<Void>

Parameters

user’s email and password
userLogin: UserLogin

Returns

callback with user’s object
Call: <Void>

Errors

None

Examples

iOS

let userService = Karhoo.getUserService()

userService.logout().execute { result in
    if result.isSuccess() {
        print("User was successfully logged out")
    } else if error = result.errorValue() {
        print("Failed with error: \(error.code) \(error.message)")
    }
}

Android

val userService = KarhooApi.userService

userService.logout()