auth0-flutter icon indicating copy to clipboard operation
auth0-flutter copied to clipboard

Stopped throwing WebAuthenticationException at user cancellation of login flow

Open carmaa opened this issue 1 year ago • 0 comments

Checklist

  • [X] The issue can be reproduced in the auth0_flutter sample app (or N/A).
  • [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • [X] I have looked into the API documentation and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

Description

Seems like the module has stopped throwing WebAuthenticationException on user cancellation of the login flow? This does not work any more:

try {
      credentials = await _auth0
          .webAuthentication(scheme: dotenv.env["AUTH0_SCHEME"]!)
          .login(
              parameters: {'screen_hint': 'signup'},
              audience: dotenv.env["AUTH0_AUDIENCE"]!,
              useEphemeralSession: true);
    } on WebAuthenticationException catch (e) {
      if (e.code == userCancelled) {
        logger.d('User aborted sign up');
        return;
      }
    }

If I cancel the flow, no exception is thrown.

Reproduction

  1. Run the test app and try to catch WebAuthenticationException when login flow is cancelled
  2. ...

Additional context

No response

auth0_flutter version

1.7.1

Flutter version

3.19.6

Platform

iOS

Platform version(s)

16

carmaa avatar May 08 '24 21:05 carmaa