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

Stop using VoidCallback on WebAuth Logout #424

Merged
merged 1 commit into from
Jan 11, 2021
Merged

Conversation

lbalmaceda
Copy link
Contributor

Changes

This VoidCallback usage is now replaced with a generic Callback<Void, AuthenticationException>. The "new" exception type has helpers to quickly check common error scenarios. e.g. browser app not available or user closed the browser. Besides the type change, the behavior of the class is the same.

The change is documented in the migration guide, and the tests have been updated.

Previously

onFailure(Auth0Exception error){
  if (error) {
    // logout failed, cause unknown.
  }
}

Now

onFailure(AuthenticationException error){
  if (error.isBrowserAppNotAvailable) {
    // Guide user to install a compatible browser app
  } else if (error.isAuthenticationCanceled) {
    // User closed the browser app and canceled the logout
  }
}

@lbalmaceda lbalmaceda added this to the v2-Next milestone Jan 11, 2021
@lbalmaceda lbalmaceda requested a review from a team as a code owner January 11, 2021 14:06
@lbalmaceda lbalmaceda merged commit deee9bf into v2-dev Jan 11, 2021
@lbalmaceda lbalmaceda deleted the rf-logout-callback branch January 11, 2021 14:24
@lbalmaceda lbalmaceda modified the milestones: v2-Next, 2.0.0-beta.0 Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants