[Firebase Authentication] Get ERROR_OPERATION_NOT_ALLOWED instead of ERROR_ADMIN_RESTRICTED_OPERATION when anonymous authentication disabled #2935
Labels
blocked: customer-response
Waiting for customer response, e.g. more information was requested.
plugin: auth
resolution: needs-repro
This issue could not be reproduced or needs an up to date reproduction on latest FlutterFire plugin.
type: enhancement
New feature or request
When I try to call FirebaseAuth.instance.signInAnonymously() with anonymous authentication disabled, I get the following error:
To Reproduce
Implement the following code, e.g. in an onPressed callback of a FlatButton:
Expected behavior
According to the documentation, the error I should be getting in this case is: ERROR_OPERATION_NOT_ALLOWED.
No stack trace should be printed if the error is in a try-catch statement.
Additional context
I'm using:
firebase_auth: ^0.16.1
Flutter doctor
[✓] Flutter (Channel beta, 1.19.0-4.3.pre, on Mac OS X 10.15.5 19F101, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[!] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.47.0)
[✓] Connected device (3 available)
The text was updated successfully, but these errors were encountered: