logout method

Future<void> logout({
  1. bool? federated,
  2. String? returnToUrl,
})

Redirects the browser to the Auth0 logout endpoint to end the user's session.

  • Use returnToUrl to tell Auth0 where it should redirect back to once the user has logged out. This URL must be registered in Allowed Logout URLs in your Auth0 client settings. Read more about how redirecting after logout works. Note: If returnToUrl is not explicitly set, the server will return the user to the first Allowed Logout URL defined in the client settings in the dashboard. Read more.
  • Use federated to log the user out of their identity provider (such as Google) as well as Auth0. Only applicable if the user authenticated using an identity provider. Read more about how federated logout works at Auth0.

Implementation

Future<void> logout({final bool? federated, final String? returnToUrl}) =>
    Auth0FlutterWebPlatform.instance
        .logout(LogoutOptions(federated: federated, returnTo: returnToUrl));