Skip to content

Add OnSuccessHandler and OnFailureHandler to logoutUser() function #765

@yungkienpoh-prestolabs

Description

@yungkienpoh-prestolabs

Hi, I noticed in logoutUser() function, there are no OnSuccessHandler and OnFailureHandler parameters for us to handle the cases where calling disableDevice API returns error. disableDeviceForCurrentUser already has these 2 parameters for handling such case. So, my request is to add these 2 parameters to logoutUser() and logoutPreviousUser() function, so that we can handle the error cases when logging out the user.

The end result should be something like this:

func logoutUser(withOnSuccess onSuccess: OnSuccessHandler? = nil, onFailure: OnFailureHandler? = nil) {
    logoutPreviousUser(withOnSuccess: onSuccess, onFailure: onFailure)
}
private func logoutPreviousUser(withOnSuccess onSuccess: OnSuccessHandler? = nil, onFailure: OnFailureHandler? = nil) {
    ...
    if config.autoPushRegistration {
        disableDeviceForCurrentUser(withOnSuccess: onSuccess, onFailure: onFailure)
    }
    ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions