Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OnSuccessHandler and OnFailureHandler to logoutUser() function #765

Open
yungkienpoh-prestolabs opened this issue May 2, 2024 · 1 comment

Comments

@yungkienpoh-prestolabs
Copy link

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)
    }
    ...
}
@jena-chakour
Copy link
Contributor

Hi @yungkienpoh-prestolabs thanks for surfacing this! Our team will take this into consideration for future work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants