auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
59 stars 41 forks source link

Stopped throwing WebAuthenticationException at user cancellation of login flow #450

Open carmaa opened 4 months ago

carmaa commented 4 months ago

Checklist

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