flutterfire
flutterfire copied to clipboard
[firebase_auth]: ActionCodeOperation mapping fails due to incorrect requestType casting in ActionCodeInfo
Is there an existing issue for this?
- [x] I have searched the existing issues.
Which plugins are affected?
Auth
Which platforms are affected?
iOS
Description
I've already reported this issue in Firebes iOS SDK https://github.com/firebase/firebase-ios-sdk/issues/15010.
In FirebaseAuth/Sources/Swift/ActionCode/ActionCodeInfo.swift, the method actionCodeOperation(forRequestType:) uses camelCase (e.g. "resetPassword", "verifyEmail") to match against the request type string received from the server.
This method should use SCREAMING_SNAKE_CASE.
Because of this mismatch, the method always returns .unknown.
The iOS SDK works as expected, probably the bug comes from flutterfire? I'm not sure.
Reproducing the issue
- In flutter, try to check an action code:
final action = await _auth.checkActionCode(emailLink.code);
final operation = action.operation;
final isEmailValidation = operation == ActionCodeInfoOperation.verifyEmail;
- When passed to
actionCodeOperation(forRequestType:), the internal mapping in ActionCodeInfo returns .unknown. - On iOS
isEmailValidationis false, because operation is always returningActionCodeInfoOperation.unknown.
Firebase Core version
3.14.0
Flutter Version
3.32.2
Relevant Log Output
Flutter dependencies
Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.
Additional context and comments
Debug screenshots: