flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[firebase_auth]: ActionCodeOperation mapping fails due to incorrect requestType casting in ActionCodeInfo

Open emisanpre opened this issue 5 months ago • 16 comments

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

  1. In flutter, try to check an action code:
final action = await _auth.checkActionCode(emailLink.code);
final operation = action.operation;
final isEmailValidation = operation == ActionCodeInfoOperation.verifyEmail;
  1. When passed to actionCodeOperation(forRequestType:), the internal mapping in ActionCodeInfo returns .unknown.
  2. On iOS isEmailValidation is false, because operation is always returning ActionCodeInfoOperation.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: Image Image

emisanpre avatar Jun 24 '25 15:06 emisanpre