currentUser

Returns the currently logged in user. This endpoint will return an optional User. This means the user could be null and is not guaranteed to be logged in unless the login endpoint was called previously. If the logout endpoint was called no user is available until login is called again.

currentUser() : UserInfo

Examples

iOS

let userService = Karhoo.getUserService()
if let user = userService.getCurrentUser() {
    print("Logged used \(user.firstName) \(user.lastName)")
}

Android

val userStore = KarhooApi.userStore

val userInfo = userStore.currentUser