Skip to content

feat: Swift Package Manager dependency support for Flutter iOS/macOS SDK#804

Open
NandanPrabhu wants to merge 13 commits into
mainfrom
flutter-pod-to-spm
Open

feat: Swift Package Manager dependency support for Flutter iOS/macOS SDK#804
NandanPrabhu wants to merge 13 commits into
mainfrom
flutter-pod-to-spm

Conversation

@NandanPrabhu

@NandanPrabhu NandanPrabhu commented Apr 2, 2026

Copy link
Copy Markdown
Contributor
  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

📋 Changes

Adds Swift Package Manager (SPM) support to the iOS/macOS (darwin) native plugin, addressing #793. CocoaPods support is retained as a fallback, so this is non-breaking for existing consumers.

Packaging

  • Adds auth0_flutter/darwin/auth0_flutter/Package.swift declaring the auth0_flutter SPM target (iOS 14 / macOS 11), depending on Auth0.swift, JWTDecode.swift and SimpleKeychain via .upToNextMajor(from:) so the plugin stays co-installable with consumer apps that pull the same Auth0 packages.
  • Updates auth0_flutter.podspec source_files to point at the new shared Sources/auth0_flutter layout; version pins kept in sync with Package.swift.
  • Moves the shared Darwin sources under Sources/auth0_flutter, relying on sharedDarwinSource: true (declared in pubspec.yaml) so iOS and macOS build from a single source tree.

Removed symlink machinery

  • Deletes scripts/generate-symlinks.sh and the check-symlinks workflow — sharedDarwinSource replaces the per-platform symlink approach.
  • Removes the duplicated auth0_flutter/ios and auth0_flutter/macos symlinked source trees.

Plugin entry point

  • Removes the Objective-C shim (Auth0FlutterPlugin.h/.m) and renames the Swift plugin class SwiftAuth0FlutterPluginAuth0FlutterPlugin to match the pluginClass already declared in pubspec.yaml. No public Dart API change.

Example app

  • iOS/macOS example projects migrated from CocoaPods (Podfile, workspace) to SPM (Package.resolved, project-based build).
  • macOS AppDelegate adopts @main + applicationSupportsSecureRestorableState.

CI

  • setup-darwin: drops the Ruby/Bundler and pod install steps; enables SPM (flutter config --enable-swift-package-manager) and forces the Flutter-generated package's deployment target to match the plugin's (14.0 / 11.0).
  • unit-tests-darwin: runs against Runner.xcodeproj instead of the (now removed) workspace.
  • iOS coverage is converted from .xcresult to Cobertura XML via xcresultparser (Ruby-free) before the Codecov upload, replacing the removed slather step. The orphaned example/ios/Gemfile/Gemfile.lock (slather only) are deleted.

Tests

  • Plugin registration tests renamed to Auth0FlutterPluginTests.
  • Credentials Manager tests use credentialsManager.store(credentials:) instead of hand-built NSKeyedArchiver fixtures.

📎 References

🎯 Testing

  • iOS and macOS native unit tests run in CI via xcodebuild against Runner.xcodeproj (Xcode 26.2); Android and Windows unit suites unchanged.
  • Manual verification: from auth0_flutter/example, run flutter config --enable-swift-package-manager then flutter build ios / flutter build macos and exercise login/logout, credentials manager, and DPoP flows.
  • CocoaPods fallback can be verified by building the example with SPM disabled.

Reviewer note: this PR is large by file count because it removes the symlinked ios/macos source trees and moves sources under Sources/auth0_flutter — most files are pure moves/deletions; the substantive surface is Package.swift, the podspec, the CI actions, and the plugin/test renames.

Summary by CodeRabbit

  • New Features

    • Added MyAccount API for managing authentication methods (enrollment, verification, deletion, and updates for email, phone, TOTP, passkeys, push notifications, and recovery codes).
  • Documentation

    • Clarified iOS/macOS native dependency resolution using Swift Package Manager when enabled.
  • Chores

    • Migrated to Swift Package Manager for Darwin builds; updated CI/CD workflows and native build configuration.

@NandanPrabhu NandanPrabhu changed the title cocoapods to spm conversion feat: Flutter SPM support for iOS plugin Apr 2, 2026
@NandanPrabhu NandanPrabhu marked this pull request as ready for review April 8, 2026 14:08
@NandanPrabhu NandanPrabhu requested a review from a team as a code owner April 8, 2026 14:08
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 43ce9a2b-7c6a-468b-ad78-955307e4459c

📥 Commits

Reviewing files that changed from the base of the PR and between 04c84ad and 5a55934.

⛔ Files ignored due to path filters (21)
  • auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountConfirmEnrollmentMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountDeleteAuthMethodMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollEmailMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollPasskeyChallengeMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollPasskeyMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollPhoneMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollPushMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollRecoveryCodeMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountEnrollTotpMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountGetAuthMethodMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountGetAuthMethodsMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountGetFactorsMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountUpdateAuthMethodMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/MyAccount/MyAccountVerifyOtpMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved is excluded by !**/example/**
📒 Files selected for processing (1)
  • auth0_flutter/darwin/auth0_flutter/Package.swift

Walkthrough

Migrates the Darwin plugin from CocoaPods/Ruby to Swift Package Manager by adding a Package.swift manifest, converting darwin/Classes files to symlinks pointing at Sources/auth0_flutter, removing the symlink-generation script and CI workflow, updating all CI actions, and adding a complete MyAccountAPI handler suite for MFA factor enrollment and management.

Changes

Swift Package Manager Migration

Layer / File(s) Summary
SwiftPM manifest, podspec path, plugin rename, UIKit import
auth0_flutter/darwin/auth0_flutter/Package.swift, auth0_flutter/darwin/auth0_flutter.podspec, auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Auth0FlutterPlugin.swift, auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthModels.swift
Adds Package.swift with iOS 14.0/macOS 11.0 platforms, auth0-flutter product, upstream dependency constraints, local FlutterFramework path, and PASSKEYS_PLATFORM define. Updates podspec glob to auth0_flutter/Sources/auth0_flutter/**/*. Renames SwiftAuth0FlutterPluginAuth0FlutterPlugin. Adds UIKit import inside the iOS-only block of WebAuthModels.swift.
darwin/Classes symlinks and SwiftPM gitignore entries
auth0_flutter/darwin/Classes/**/*, .gitignore, auth0_flutter/darwin/.gitignore, auth0_flutter/ios/.gitignore, auth0_flutter/macos/.gitignore
All darwin/Classes/**/*.swift paths are converted to symbolic links targeting the canonical Sources/auth0_flutter implementation. Adds SwiftPM artifact ignores (.build/, .swiftpm/, Package.resolved, FlutterFramework/) to all relevant .gitignore files. Removes scripts/generate-symlinks.sh.
CI setup-darwin action: CocoaPods → SwiftPM
.github/actions/setup-darwin/action.yml
Drops the ruby input, removes Ruby/CocoaPods steps, and adds flutter config --enable-swift-package-manager, flutter pub get, and platform-conditional sed steps to patch generated Package.swift minimum deployment targets — failing explicitly if the file is missing.
CI workflow: Ruby removal, SPM enablement, xcresultparser coverage
.github/workflows/main.yml, .github/actions/setup-publish/action.yml, .github/actions/setup-android/action.yml, .github/workflows/check-symlinks.yml
Removes env.ruby and stops passing ruby to setup-darwin. Adds flutter config --enable-swift-package-manager in setup-publish. Parameterizes Android Flutter version via inputs.flutter. Replaces slather+Cobertura upload with xcresultparser converting unit-tests.xcresultcoverage.xml. Removes check-symlinks workflow.
README dependency management note
auth0_flutter/README.md
Adds a note stating SPM is used when enabled in Flutter, otherwise CocoaPods is the fallback with no extra setup.

MyAccountAPI MFA Handler Suite

Layer / File(s) Summary
MyAccountExtensions: error mapping and model serialization
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swift
Adds FlutterError(from: MyAccountError) including _errorFlags network indicator, and asDictionary() on AuthenticationMethod, PhoneEnrollmentChallenge, EmailEnrollmentChallenge, TOTPEnrollmentChallenge, PushEnrollmentChallenge, RecoveryCodeEnrollmentChallenge. Passkey variants (PasskeyEnrollmentChallenge, PasskeyAuthenticationMethod) guarded by PASSKEYS_PLATFORM and #available.
MyAccountHandler: channel registration and dispatch
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swift
Adds MyAccountHandler as the FlutterPlugin for auth0.com/auth0_flutter/my_account. Defines Method enum, dependency-injected clientProvider (±DPoP) and methodHandlerProvider, and handle(_:result:) that validates Account, UserAgent, accessToken, resolves the handler, and delegates — returning FlutterMethodNotImplemented for unknown methods.
Get/delete/update authentication method handlers
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccount{Get,Delete,Update}Auth*MethodHandler.swift, ...MyAccountGetFactorsMethodHandler.swift
Adds handlers to fetch by id, list by optional type, list factor type+usage dicts, delete by id (returns nil), and update name/preferredAuthenticationMethod. All bridge Flutter arguments to Auth0 async calls and return dictionaries or FlutterError.
Factor enrollment handlers (email, phone, TOTP, push, recovery code)
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnroll{Email,Phone,Totp,Push,RecoveryCode}MethodHandler.swift
Adds five enrollment handlers. Phone handler maps voice/sms from the type argument. Each validates required arguments, starts the Auth0 enrollment flow, and returns the challenge dictionary or FlutterError.
Enrollment confirmation and OTP verification handlers
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift, ...MyAccountVerifyOtpMethodHandler.swift
MyAccountConfirmEnrollmentMethodHandler routes to push-notification or recovery-code confirmation by factorType. MyAccountVerifyOtpMethodHandler routes to email, TOTP, or phone OTP confirmation. Both validate id, authSession, and factor-specific args before delegating.
Passkey enrollment challenge and enrollment handlers
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskey{Challenge,}MethodHandler.swift
PASSKEYS_PLATFORM-guarded. Challenge handler fetches by userIdentityId+connection. Enrollment handler reconstructs PasskeyEnrollmentChallenge via JSONDecoder with locationHeader CodingUserInfoKey, base64url-decodes credential fields into ReconstructedNewPasskey, and calls the Auth0 enroll API.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • auth0/auth0-flutter#857: Directly overlaps — adds iOS/macOS passkey enrollment support including MyAccountEnrollPasskeyChallengeMethodHandler, MyAccountEnrollPasskeyMethodHandler, and MyAccountHandler.Method routing cases that are also added here.
  • auth0/auth0-flutter#858: Adds/updates AuthAPIHandler passkey method cases and AuthAPIPasskey* Swift implementations that share the same PASSKEYS_PLATFORM conditional compilation pattern introduced in this PR's Package.swift.
  • auth0/auth0-flutter#835: Introduces the same MyAccountHandler and MyAccount*MethodHandler.swift classes as part of the MFA auth-method management feature that this PR builds on.

Suggested reviewers

  • pmathew92

🛠️ No more Ruby, no more CocoaPods refrain,
SPM rides in like a Swift-powered train.
Symlinks now point to a singular source,
MyAccountHandler charts a clean course.
🔐 Passkeys, OTPs, enrollments galore —
Auth0 on Darwin has never done more!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Swift Package Manager dependency support to the Flutter SDK for iOS/macOS platforms.
Linked Issues check ✅ Passed The PR fully implements SPM support per issue #793: adds Package.swift with iOS 14/macOS 11 targets, updates podspec, removes symlink scripts, renames plugin class, updates CI workflows to enable SPM, and maintains CocoaPods compatibility.
Out of Scope Changes check ✅ Passed All changes directly support SPM migration: Package.swift, podspec updates, source reorganization, symlink removal, CI/workflow updates, plugin registration refactoring, and test infrastructure changes align with issue #793 requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch flutter-pod-to-spm

@sanchitmehtagit

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@@ -1 +0,0 @@
../../../darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to delete this file?

NandanPrabhu and others added 6 commits June 12, 2026 19:19
flutter config --enable-swift-package-manager must run after Flutter
is installed and before flutter pub get so that SPM-based dependencies
(Auth0.swift resolved via Package.swift) are properly set up when
building and running native iOS/macOS unit tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The FlutterGeneratedPluginSwiftPackage (created during flutter pub get)
picks up the iOS deployment target from the Xcode toolchain. When Xcode
was configured after pub get, the generated Package.swift defaulted to
iOS 13.0 instead of reading the project's IPHONEOS_DEPLOYMENT_TARGET
of 14.0, causing:

  error: The package product 'auth0-flutter' requires minimum platform
  version 14.0 for the iOS platform, but this target supports 13.0

Fix: move "Setup Xcode" and "Save Xcode version" steps before
"Enable Swift Package Manager" and "flutter pub get".

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/actions/setup-darwin/action.yml:
- Around line 55-67: The conditional gates on lines 55 and 66 perform
case-sensitive comparisons against inputs.platform ('iOS' and 'macOS'), which
will fail if the input is provided in lowercase ('ios' or 'macos'), causing the
deployment target patches to be skipped. Replace the case-sensitive comparisons
in both the "Fix iOS minimum deployment target for SPM" and "Fix macOS minimum
deployment target for SPM" step conditions with references to the normalized
lowercase-platform variable that is created earlier in the action, ensuring
consistent platform matching regardless of input casing.

In `@auth0_flutter/darwin/auth0_flutter.podspec`:
- Line 7: The s.version assignment in the podspec file is set to 2.1.0 but needs
to be updated to 2.2.0 to match the version specified in pubspec.yaml. Update
the version string in the s.version property from 2.1.0 to 2.2.0 to ensure
version consistency across CocoaPods and pub.dev distributions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cbde8b59-8991-4c69-9aec-362eb698d5f7

📥 Commits

Reviewing files that changed from the base of the PR and between 32a6b50 and 7917cc9.

⛔ Files ignored due to path filters (112)
  • auth0_flutter/example/android/gradle.properties is excluded by !**/example/**
  • auth0_flutter/example/android/settings.gradle is excluded by !**/example/**
  • auth0_flutter/example/ios/Gemfile is excluded by !**/example/**
  • auth0_flutter/example/ios/Gemfile.lock is excluded by !**/*.lock, !**/example/**, !**/*.lock
  • auth0_flutter/example/ios/Podfile is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner/AppDelegate.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPISpies.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerGetMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHasValidMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSSOCredentialsMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSpies.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/Mocks.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/SwiftAuth0FlutterPluginTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/WebAuth/WebAuthExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/WebAuth/WebAuthHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/lib/example_app.dart is excluded by !**/example/**
  • auth0_flutter/example/macos/Podfile is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedata is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner/AppDelegate.swift is excluded by !**/example/**
  • auth0_flutter/ios/Classes/Auth0FlutterPlugin.h is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/Auth0FlutterPlugin.m is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPISignupMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/SSOExchangeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerModels.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/DPoP/DPoPClearKeyMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/DPoP/DPoPGetHeadersMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/DPoP/DPoPHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/Extensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/HandlerError.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/MethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/Models.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/Properties.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/SwiftAuth0FlutterPlugin.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/WebAuth/WebAuthExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/WebAuth/WebAuthHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/WebAuth/WebAuthLoginMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/WebAuth/WebAuthLogoutMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/WebAuth/WebAuthModels.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/macos/Classes/Auth0FlutterPlugin.h is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/Auth0FlutterPlugin.m is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPISignupMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/SSOExchangeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerModels.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/DPoP/DPoPClearKeyMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/DPoP/DPoPGetHeadersMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/DPoP/DPoPHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/Extensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/HandlerError.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/MethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/Models.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/Properties.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/SwiftAuth0FlutterPlugin.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/WebAuth/WebAuthExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/WebAuth/WebAuthHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/WebAuth/WebAuthLoginMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/WebAuth/WebAuthLogoutMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/WebAuth/WebAuthModels.swift is excluded by !auth0_flutter/macos/Classes/**
📒 Files selected for processing (65)
  • .github/actions/setup-android/action.yml
  • .github/actions/setup-darwin/action.yml
  • .github/actions/setup-publish/action.yml
  • .github/actions/unit-tests-darwin/action.yml
  • .github/workflows/check-symlinks.yml
  • .github/workflows/main.yml
  • .gitignore
  • auth0_flutter/README.md
  • auth0_flutter/darwin/.gitignore
  • auth0_flutter/darwin/Classes/Auth0FlutterPlugin.h
  • auth0_flutter/darwin/Classes/Auth0FlutterPlugin.m
  • auth0_flutter/darwin/auth0_flutter.podspec
  • auth0_flutter/darwin/auth0_flutter/Package.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Auth0FlutterPlugin.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Extensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/HandlerError.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Models.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Properties.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthModels.swift
  • auth0_flutter/ios/.gitignore
  • auth0_flutter/ios/Assets/.gitkeep
  • auth0_flutter/ios/auth0_flutter.podspec
  • auth0_flutter/macos/.gitignore
  • auth0_flutter/macos/Assets/.gitkeep
  • auth0_flutter/macos/auth0_flutter.podspec
  • scripts/generate-symlinks.sh
💤 Files with no reviewable changes (10)
  • auth0_flutter/ios/Assets/.gitkeep
  • auth0_flutter/macos/.gitignore
  • auth0_flutter/macos/Assets/.gitkeep
  • auth0_flutter/darwin/Classes/Auth0FlutterPlugin.m
  • scripts/generate-symlinks.sh
  • auth0_flutter/ios/.gitignore
  • auth0_flutter/macos/auth0_flutter.podspec
  • .github/workflows/check-symlinks.yml
  • auth0_flutter/darwin/Classes/Auth0FlutterPlugin.h
  • auth0_flutter/ios/auth0_flutter.podspec

Comment on lines +55 to +67
if: inputs.platform == 'iOS'
run: |
PACKAGE_FILE="auth0_flutter/example/ios/Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage/Package.swift"
if [ ! -f "$PACKAGE_FILE" ]; then
echo "::error::FlutterGeneratedPluginSwiftPackage/Package.swift not found at expected path"
exit 1
fi
sed -i '' 's/\.iOS(".*")/\.iOS("14.0")/g' "$PACKAGE_FILE"
shell: bash

- name: Install pods
working-directory: auth0_flutter/example/${{ steps.lowercase-platform.outputs.platform }}
run: pod install
- name: Fix macOS minimum deployment target for SPM
if: inputs.platform == 'macOS'
run: |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use normalized platform output in conditional gates.

Line 55 and Line 66 compare inputs.platform case-sensitively; ios/macos inputs would skip the deployment-target patch and can reintroduce platform mismatch failures. Reuse the normalized value from lowercase-platform.

Suggested fix
-    - name: Fix iOS minimum deployment target for SPM
-      if: inputs.platform == 'iOS'
+    - name: Fix iOS minimum deployment target for SPM
+      if: steps.lowercase-platform.outputs.platform == 'ios'
@@
-    - name: Fix macOS minimum deployment target for SPM
-      if: inputs.platform == 'macOS'
+    - name: Fix macOS minimum deployment target for SPM
+      if: steps.lowercase-platform.outputs.platform == 'macos'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/setup-darwin/action.yml around lines 55 - 67, The
conditional gates on lines 55 and 66 perform case-sensitive comparisons against
inputs.platform ('iOS' and 'macOS'), which will fail if the input is provided in
lowercase ('ios' or 'macos'), causing the deployment target patches to be
skipped. Replace the case-sensitive comparisons in both the "Fix iOS minimum
deployment target for SPM" and "Fix macOS minimum deployment target for SPM"
step conditions with references to the normalized lowercase-platform variable
that is created earlier in the action, ensuring consistent platform matching
regardless of input casing.

Comment thread auth0_flutter/darwin/auth0_flutter.podspec Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@auth0_flutter/darwin/auth0_flutter.podspec`:
- Line 22: The Auth0 dependency version is pinned to 2.21.2 in the podspec but
allows a version range starting from 2.18.0 in Package.swift, creating a
mismatch between package managers. Update the version constraint in
Package.swift to match the pinned version 2.21.2 that is specified in the
podspec dependency declaration to ensure both CocoaPods and SwiftPM resolve the
same Auth0 version and maintain consistency across package managers.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift`:
- Around line 25-29: Replace implicit fallback routing with explicit validation
for enum-like string arguments across three handler files. In
MyAccountConfirmEnrollmentMethodHandler.swift lines 25-29, replace the if/else
structure with a switch statement that explicitly handles "push-notification"
and returns a FlutterError for any unsupported factorType values instead of
defaulting to confirmRecoveryCodeEnrollment. In
MyAccountEnrollPhoneMethodHandler.swift line 20, validate that the type
parameter only accepts "sms" or "voice" and return a FlutterError for any other
value instead of implicitly proceeding with an unsupported type. In
MyAccountVerifyOtpMethodHandler.swift lines 28-35, add explicit validation that
maps only supported OTP factor types and return a FlutterError when an unknown
factor type is encountered instead of silently handling it with a fallback.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift`:
- Around line 13-19: The type parameter extraction in
MyAccountGetAuthMethodsMethodHandler uses flatMap to silently convert
unrecognized type values to nil, which causes the subsequent
getAuthenticationMethods call to fetch all authentication methods instead of
rejecting invalid input. Instead, first extract the type as an optional String
from arguments, then explicitly check if a type value was provided. If a type
string is present but does not match any valid AuthenticationMethodType value,
return a FlutterError to reject the malformed input. Only proceed with the
getAuthenticationMethods call if the type is either nil (not provided) or a
valid AuthenticationMethodType.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift`:
- Around line 18-27: The current implementation in
MyAccountUpdateAuthMethodMethodHandler silently converts unknown
preferredAuthenticationMethod strings to nil via flatMap, which allows invalid
input to proceed as if the preference change was not requested. Instead of
allowing this silent failure, add validation logic that checks if the
preferredAuthenticationMethod string (when provided) is a valid case in the
PreferredAuthenticationMethod enum, and if not, return an error result
immediately rather than proceeding with the updateAuthenticationMethod call.
This ensures invalid input fails fast and prevents misleading success responses
when malformed data is submitted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 21009743-c1f7-40f8-a8d9-6d5cc199fef7

📥 Commits

Reviewing files that changed from the base of the PR and between 7917cc9 and b358d1c.

⛔ Files ignored due to path filters (13)
  • auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
📒 Files selected for processing (107)
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/auth0_flutter.podspec
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
  • auth0_flutter/ios/.gitignore
  • auth0_flutter/macos/.gitignore

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@auth0_flutter/darwin/auth0_flutter.podspec`:
- Line 22: The Auth0 dependency version is pinned to 2.21.2 in the podspec but
allows a version range starting from 2.18.0 in Package.swift, creating a
mismatch between package managers. Update the version constraint in
Package.swift to match the pinned version 2.21.2 that is specified in the
podspec dependency declaration to ensure both CocoaPods and SwiftPM resolve the
same Auth0 version and maintain consistency across package managers.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift`:
- Around line 25-29: Replace implicit fallback routing with explicit validation
for enum-like string arguments across three handler files. In
MyAccountConfirmEnrollmentMethodHandler.swift lines 25-29, replace the if/else
structure with a switch statement that explicitly handles "push-notification"
and returns a FlutterError for any unsupported factorType values instead of
defaulting to confirmRecoveryCodeEnrollment. In
MyAccountEnrollPhoneMethodHandler.swift line 20, validate that the type
parameter only accepts "sms" or "voice" and return a FlutterError for any other
value instead of implicitly proceeding with an unsupported type. In
MyAccountVerifyOtpMethodHandler.swift lines 28-35, add explicit validation that
maps only supported OTP factor types and return a FlutterError when an unknown
factor type is encountered instead of silently handling it with a fallback.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift`:
- Around line 13-19: The type parameter extraction in
MyAccountGetAuthMethodsMethodHandler uses flatMap to silently convert
unrecognized type values to nil, which causes the subsequent
getAuthenticationMethods call to fetch all authentication methods instead of
rejecting invalid input. Instead, first extract the type as an optional String
from arguments, then explicitly check if a type value was provided. If a type
string is present but does not match any valid AuthenticationMethodType value,
return a FlutterError to reject the malformed input. Only proceed with the
getAuthenticationMethods call if the type is either nil (not provided) or a
valid AuthenticationMethodType.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift`:
- Around line 18-27: The current implementation in
MyAccountUpdateAuthMethodMethodHandler silently converts unknown
preferredAuthenticationMethod strings to nil via flatMap, which allows invalid
input to proceed as if the preference change was not requested. Instead of
allowing this silent failure, add validation logic that checks if the
preferredAuthenticationMethod string (when provided) is a valid case in the
PreferredAuthenticationMethod enum, and if not, return an error result
immediately rather than proceeding with the updateAuthenticationMethod call.
This ensures invalid input fails fast and prevents misleading success responses
when malformed data is submitted.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 21009743-c1f7-40f8-a8d9-6d5cc199fef7

📥 Commits

Reviewing files that changed from the base of the PR and between 7917cc9 and b358d1c.

⛔ Files ignored due to path filters (13)
  • auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
📒 Files selected for processing (107)
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/auth0_flutter.podspec
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
  • auth0_flutter/ios/.gitignore
  • auth0_flutter/macos/.gitignore
🛑 Comments failed to post (4)
auth0_flutter/darwin/auth0_flutter.podspec (1)

22-22: ⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Podspec Auth0 dependency:"
rg -n "s\\.dependency 'Auth0'" auth0_flutter/darwin/auth0_flutter.podspec

echo "SwiftPM Auth0 dependency floor:"
rg -n 'Auth0\\.swift".*upToNextMajor\\(from:' auth0_flutter/darwin/auth0_flutter/Package.swift

Repository: auth0/auth0-flutter

Length of output: 295


🏁 Script executed:

cat auth0_flutter/darwin/auth0_flutter/Package.swift

Repository: auth0/auth0-flutter

Length of output: 1187


Align Auth0 dependency versions between CocoaPods and SwiftPM.

Podspec pins Auth0 to 2.21.2, while Package.swift allows 2.18.0 and up via .upToNextMajor(from: "2.18.0"). This permits different Auth0 versions to be resolved depending on the package manager, risking behavioral or security divergence in token handling.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@auth0_flutter/darwin/auth0_flutter.podspec` at line 22, The Auth0 dependency
version is pinned to 2.21.2 in the podspec but allows a version range starting
from 2.18.0 in Package.swift, creating a mismatch between package managers.
Update the version constraint in Package.swift to match the pinned version
2.21.2 that is specified in the podspec dependency declaration to ensure both
CocoaPods and SwiftPM resolve the same Auth0 version and maintain consistency
across package managers.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift (1)

25-29: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Validate enum-like method-channel string arguments before dispatching Auth0 requests.
The shared root cause is implicit fallback routing for unrecognized string values (type/factorType), which sends malformed input to incorrect API calls instead of returning an argument error.

  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift#L25-L29: replace if/else fallback with explicit switch for supported factor types and return FlutterError for unsupported values.
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift#L20-L20: accept only "sms"/"voice" and return FlutterError for anything else.
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift#L28-L35: explicitly map supported OTP factor types and return FlutterError on unknown values.
📍 Affects 3 files
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift#L25-L29 (this comment)
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift#L20-L20
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift#L28-L35
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift`
around lines 25 - 29, Replace implicit fallback routing with explicit validation
for enum-like string arguments across three handler files. In
MyAccountConfirmEnrollmentMethodHandler.swift lines 25-29, replace the if/else
structure with a switch statement that explicitly handles "push-notification"
and returns a FlutterError for any unsupported factorType values instead of
defaulting to confirmRecoveryCodeEnrollment. In
MyAccountEnrollPhoneMethodHandler.swift line 20, validate that the type
parameter only accepts "sms" or "voice" and return a FlutterError for any other
value instead of implicitly proceeding with an unsupported type. In
MyAccountVerifyOtpMethodHandler.swift lines 28-35, add explicit validation that
maps only supported OTP factor types and return a FlutterError when an unknown
factor type is encountered instead of silently handling it with a fallback.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift (1)

13-19: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Reject invalid type values instead of widening the query.

Line 13-Line 15 converts unknown type values to nil, and Line 18 then fetches all authentication methods. That silently turns malformed input into a broader read path. Return a FlutterError when type is present but not recognized.

Proposed fix
     func handle(with arguments: [String: Any], callback: `@escaping` FlutterResult) {
-        let type = (arguments["type"] as? String)
-            .flatMap(AuthenticationMethodType.init(rawValue:))
+        let typeRaw = arguments["type"] as? String
+        let type: AuthenticationMethodType?
+        if let typeRaw {
+            guard let parsed = AuthenticationMethodType(rawValue: typeRaw) else {
+                return callback(FlutterError(from: .requiredArgumentMissing("type")))
+            }
+            type = parsed
+        } else {
+            type = nil
+        }
 
         client
             .authenticationMethods
             .getAuthenticationMethods(type: type)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift`
around lines 13 - 19, The type parameter extraction in
MyAccountGetAuthMethodsMethodHandler uses flatMap to silently convert
unrecognized type values to nil, which causes the subsequent
getAuthenticationMethods call to fetch all authentication methods instead of
rejecting invalid input. Instead, first extract the type as an optional String
from arguments, then explicitly check if a type value was provided. If a type
string is present but does not match any valid AuthenticationMethodType value,
return a FlutterError to reject the malformed input. Only proceed with the
getAuthenticationMethods call if the type is either nil (not provided) or a
valid AuthenticationMethodType.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift (1)

18-27: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fail fast on invalid preferredAuthenticationMethod values.

Line 18-Line 20 maps unknown strings to nil, and Line 24-Line 26 then submits an update without the intended preference change. This silently masks malformed input and can return a misleading success path.

Proposed fix
         let name = arguments["name"] as? String
-        let preferredAuthenticationMethod =
-            (arguments["preferredAuthenticationMethod"] as? String)
-                .flatMap(PreferredAuthenticationMethod.init(rawValue:))
+        let preferredAuthRaw = arguments["preferredAuthenticationMethod"] as? String
+        let preferredAuthenticationMethod: PreferredAuthenticationMethod?
+        if let preferredAuthRaw {
+            guard let parsed = PreferredAuthenticationMethod(rawValue: preferredAuthRaw) else {
+                return callback(FlutterError(from: .requiredArgumentMissing("preferredAuthenticationMethod")))
+            }
+            preferredAuthenticationMethod = parsed
+        } else {
+            preferredAuthenticationMethod = nil
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift`
around lines 18 - 27, The current implementation in
MyAccountUpdateAuthMethodMethodHandler silently converts unknown
preferredAuthenticationMethod strings to nil via flatMap, which allows invalid
input to proceed as if the preference change was not requested. Instead of
allowing this silent failure, add validation logic that checks if the
preferredAuthenticationMethod string (when provided) is a valid case in the
PreferredAuthenticationMethod enum, and if not, return an error result
immediately rather than proceeding with the updateAuthenticationMethod call.
This ensures invalid input fails fast and prevents misleading success responses
when malformed data is submitted.

- Restores darwin/Classes/ with ObjC stubs (Auth0FlutterPlugin.h/.m),
  SwiftAuth0FlutterPlugin.swift, and symlinks for all Swift source files
  pointing to darwin/auth0_flutter/Sources/auth0_flutter/
- Restores ios/ and macos/ top-level: .gitignore, Assets/.gitkeep (symlink),
  and auth0_flutter.podspec (Classes/**/* source_files, v2.2.0, Auth0 2.21.2,
  PASSKEYS_PLATFORM xcconfig)
- Restores ios/Classes/ and macos/Classes/ symlinks for all source files
  pointing through darwin/Classes/
- All darwin/ios/macos files now match main branch structure
Auth0FlutterPlugin.swift is the SPM entry point and belongs only in
darwin/auth0_flutter/Sources/auth0_flutter/. CocoaPods uses
SwiftAuth0FlutterPlugin.swift instead.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift`:
- Around line 24-29: In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
at lines 24-29, replace the current if/else block in the request assignment with
an explicit switch statement that handles only the allowed values
"push-notification" and "recovery-code", and returns a FlutterError for any
unsupported factorType to prevent coercing unknown values into an incorrect MFA
flow. Similarly, in
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
at line 20, modify the phone type mapping to explicitly handle only "sms" and
"voice" cases and return a FlutterError for any unsupported type instead of
defaulting to .sms, ensuring that invalid client input is surfaced rather than
executing an unintended operation.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift`:
- Around line 13-18: The MyAccountGetAuthMethodsMethodHandler is silently
converting invalid type values to nil by using flatMap, which then returns all
authentication methods instead of failing fast. Modify the type parameter
handling to explicitly check if the type argument was provided but invalid, and
reject the request with an error message indicating that the provided type value
is unsupported. Only pass a valid AuthenticationMethodType to the
getAuthenticationMethods(type:) call, or pass nil if the type argument was not
provided at all.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift`:
- Line 19: The dictionary being constructed in the callback within
MyAccountGetFactorsMethodHandler.swift has an issue with the "usage" key
assignment. When $0.usage is nil, the Optional wrapper is not a stable Flutter
codec type. Fix this by either conditionally including the "usage" key only when
the value is not nil, or explicitly mapping nil values to NSNull(). Modify the
factors.map closure to handle the optional usage value properly so that nil
values are either omitted from the dictionary or explicitly converted to
NSNull() instead of being wrapped in Optional.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift`:
- Around line 18-27: The current code in
MyAccountUpdateAuthMethodMethodHandler.swift silently converts an invalid
preferredAuthenticationMethod string to nil instead of validating it. Modify the
logic around line 18-27 to check if the preferredAuthenticationMethod key is
present in the arguments dictionary: if it is present and is a string, validate
that it successfully initializes to a PreferredAuthenticationMethod enum value
using the rawValue initializer; if the string doesn't map to a valid enum case,
return an argument-validation error instead of proceeding with nil; if the key
is absent from arguments, that's acceptable and should result in nil being
passed to the API call.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift`:
- Around line 28-35: Normalize argument validation across three MyAccount
handlers to reject invalid enum-like string values instead of silently falling
back to defaults. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
(lines 28-35), remove the default case that falls back to confirmPhoneEnrollment
and instead return an invalid-argument FlutterError for unsupported factorType
values. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
(lines 13-18), add validation to return an invalid-argument FlutterError when
the type parameter is provided but cannot be parsed, instead of treating it as
no filter. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
(lines 18-27), add validation to return an invalid-argument FlutterError when
the preferredAuthenticationMethod key is present but the value cannot be parsed
to a valid enum.

In `@auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift`:
- Line 1: All eight symlink files in the AuthAPI directory have miscalculated
relative paths that ascend only two levels when they need to ascend three levels
to reach the project root. For each affected file, update the symlink target
from `../../auth0_flutter/Sources/auth0_flutter/AuthAPI/[filename].swift` to
`../../../Sources/auth0_flutter/AuthAPI/[filename].swift`. Specifically: in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift (line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift`; in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift (line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swift`; in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift`;
in auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift`;
in auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9e90a4ba-dca9-450f-a605-faf918470242

📥 Commits

Reviewing files that changed from the base of the PR and between b358d1c and 04c84ad.

⛔ Files ignored due to path filters (35)
  • auth0_flutter/example/android/gradle.properties is excluded by !**/example/**
  • auth0_flutter/example/android/settings.gradle is excluded by !**/example/**
  • auth0_flutter/example/ios/Gemfile is excluded by !**/example/**
  • auth0_flutter/example/ios/Gemfile.lock is excluded by !**/*.lock, !**/example/**, !**/*.lock
  • auth0_flutter/example/ios/Podfile is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner/AppDelegate.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPISpies.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerGetMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHasValidMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSSOCredentialsMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSpies.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/Mocks.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/WebAuth/WebAuthExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/WebAuth/WebAuthHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/macos/Podfile is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedata is excluded by !**/example/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
📒 Files selected for processing (117)
  • .github/actions/setup-android/action.yml
  • .github/actions/setup-darwin/action.yml
  • .github/actions/unit-tests-darwin/action.yml
  • .github/workflows/check-symlinks.yml
  • .github/workflows/main.yml
  • .gitignore
  • auth0_flutter/README.md
  • auth0_flutter/darwin/.gitignore
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/auth0_flutter.podspec
  • auth0_flutter/darwin/auth0_flutter/Package.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
  • auth0_flutter/ios/.gitignore
  • auth0_flutter/macos/.gitignore
  • scripts/generate-symlinks.sh
💤 Files with no reviewable changes (2)
  • .github/workflows/check-symlinks.yml
  • scripts/generate-symlinks.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift`:
- Around line 24-29: In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
at lines 24-29, replace the current if/else block in the request assignment with
an explicit switch statement that handles only the allowed values
"push-notification" and "recovery-code", and returns a FlutterError for any
unsupported factorType to prevent coercing unknown values into an incorrect MFA
flow. Similarly, in
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
at line 20, modify the phone type mapping to explicitly handle only "sms" and
"voice" cases and return a FlutterError for any unsupported type instead of
defaulting to .sms, ensuring that invalid client input is surfaced rather than
executing an unintended operation.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift`:
- Around line 13-18: The MyAccountGetAuthMethodsMethodHandler is silently
converting invalid type values to nil by using flatMap, which then returns all
authentication methods instead of failing fast. Modify the type parameter
handling to explicitly check if the type argument was provided but invalid, and
reject the request with an error message indicating that the provided type value
is unsupported. Only pass a valid AuthenticationMethodType to the
getAuthenticationMethods(type:) call, or pass nil if the type argument was not
provided at all.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift`:
- Line 19: The dictionary being constructed in the callback within
MyAccountGetFactorsMethodHandler.swift has an issue with the "usage" key
assignment. When $0.usage is nil, the Optional wrapper is not a stable Flutter
codec type. Fix this by either conditionally including the "usage" key only when
the value is not nil, or explicitly mapping nil values to NSNull(). Modify the
factors.map closure to handle the optional usage value properly so that nil
values are either omitted from the dictionary or explicitly converted to
NSNull() instead of being wrapped in Optional.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift`:
- Around line 18-27: The current code in
MyAccountUpdateAuthMethodMethodHandler.swift silently converts an invalid
preferredAuthenticationMethod string to nil instead of validating it. Modify the
logic around line 18-27 to check if the preferredAuthenticationMethod key is
present in the arguments dictionary: if it is present and is a string, validate
that it successfully initializes to a PreferredAuthenticationMethod enum value
using the rawValue initializer; if the string doesn't map to a valid enum case,
return an argument-validation error instead of proceeding with nil; if the key
is absent from arguments, that's acceptable and should result in nil being
passed to the API call.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift`:
- Around line 28-35: Normalize argument validation across three MyAccount
handlers to reject invalid enum-like string values instead of silently falling
back to defaults. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
(lines 28-35), remove the default case that falls back to confirmPhoneEnrollment
and instead return an invalid-argument FlutterError for unsupported factorType
values. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
(lines 13-18), add validation to return an invalid-argument FlutterError when
the type parameter is provided but cannot be parsed, instead of treating it as
no filter. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
(lines 18-27), add validation to return an invalid-argument FlutterError when
the preferredAuthenticationMethod key is present but the value cannot be parsed
to a valid enum.

In `@auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift`:
- Line 1: All eight symlink files in the AuthAPI directory have miscalculated
relative paths that ascend only two levels when they need to ascend three levels
to reach the project root. For each affected file, update the symlink target
from `../../auth0_flutter/Sources/auth0_flutter/AuthAPI/[filename].swift` to
`../../../Sources/auth0_flutter/AuthAPI/[filename].swift`. Specifically: in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift (line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift`; in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift (line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swift`; in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift`;
in auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift`;
in auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9e90a4ba-dca9-450f-a605-faf918470242

📥 Commits

Reviewing files that changed from the base of the PR and between b358d1c and 04c84ad.

⛔ Files ignored due to path filters (35)
  • auth0_flutter/example/android/gradle.properties is excluded by !**/example/**
  • auth0_flutter/example/android/settings.gradle is excluded by !**/example/**
  • auth0_flutter/example/ios/Gemfile is excluded by !**/example/**
  • auth0_flutter/example/ios/Gemfile.lock is excluded by !**/*.lock, !**/example/**, !**/*.lock
  • auth0_flutter/example/ios/Podfile is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata is excluded by !**/example/**
  • auth0_flutter/example/ios/Runner/AppDelegate.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/AuthAPI/AuthAPISpies.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerGetMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHasValidMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSSOCredentialsMethodHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSpies.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/Mocks.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/WebAuth/WebAuthExtensionsTests.swift is excluded by !**/example/**
  • auth0_flutter/example/ios/Tests/WebAuth/WebAuthHandlerTests.swift is excluded by !**/example/**
  • auth0_flutter/example/macos/Podfile is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcodeproj/project.pbxproj is excluded by !**/example/**
  • auth0_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedata is excluded by !**/example/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/ios/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
  • auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift is excluded by !auth0_flutter/macos/Classes/**
📒 Files selected for processing (117)
  • .github/actions/setup-android/action.yml
  • .github/actions/setup-darwin/action.yml
  • .github/actions/unit-tests-darwin/action.yml
  • .github/workflows/check-symlinks.yml
  • .github/workflows/main.yml
  • .gitignore
  • auth0_flutter/README.md
  • auth0_flutter/darwin/.gitignore
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/DPoP/DPoPHandler.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/Extensions.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/HandlerError.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/MethodHandler.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Models.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/Properties.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swift
  • auth0_flutter/darwin/auth0_flutter.podspec
  • auth0_flutter/darwin/auth0_flutter/Package.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
  • auth0_flutter/ios/.gitignore
  • auth0_flutter/macos/.gitignore
  • scripts/generate-symlinks.sh
💤 Files with no reviewable changes (2)
  • .github/workflows/check-symlinks.yml
  • scripts/generate-symlinks.sh
🛑 Comments failed to post (6)
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift (1)

24-29: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Reject unsupported factor types instead of defaulting to another flow.

Unknown string values are currently coerced into a valid branch, which can execute the wrong MFA operation instead of surfacing invalid client input.

  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift#L24-L29: At Line 25, replace the if/else fallback with an explicit switch on allowed values ("push-notification", "recovery-code") and return a FlutterError for unsupported factorType.
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift#L20-L20: At Line 20, map only "sms" and "voice"; return a FlutterError for unsupported type instead of defaulting to .sms.
📍 Affects 2 files
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift#L24-L29 (this comment)
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift#L20-L20
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift`
around lines 24 - 29, In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swift
at lines 24-29, replace the current if/else block in the request assignment with
an explicit switch statement that handles only the allowed values
"push-notification" and "recovery-code", and returns a FlutterError for any
unsupported factorType to prevent coercing unknown values into an incorrect MFA
flow. Similarly, in
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift
at line 20, modify the phone type mapping to explicitly handle only "sms" and
"voice" cases and return a FlutterError for any unsupported type instead of
defaulting to .sms, ensuring that invalid client input is surfaced rather than
executing an unintended operation.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift (1)

13-18: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reject unsupported type values instead of silently widening results.

When type is provided but invalid, it currently degrades to nil and returns all authentication methods. This should fail fast as an invalid argument.

Suggested fix
-        let type = (arguments["type"] as? String)
-            .flatMap(AuthenticationMethodType.init(rawValue:))
+        let rawType = arguments["type"] as? String
+        let type = rawType.flatMap(AuthenticationMethodType.init(rawValue:))
+        if rawType != nil && type == nil {
+            return callback(FlutterError(from: .requiredArgumentInvalid("type")))
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift`
around lines 13 - 18, The MyAccountGetAuthMethodsMethodHandler is silently
converting invalid type values to nil by using flatMap, which then returns all
authentication methods instead of failing fast. Modify the type parameter
handling to explicitly check if the type argument was provided but invalid, and
reject the request with an error message indicating that the provided type value
is unsupported. Only pass a valid AuthenticationMethodType to the
getAuthenticationMethods(type:) call, or pass nil if the type argument was not
provided at all.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift (1)

19-19: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid encoding Optional.none into Flutter channel payloads.

"usage": $0.usage as Any can emit an Optional wrapper value when usage is nil, which is not a stable Flutter codec payload type. Omit the key when nil (or map explicitly to NSNull()).

Suggested fix
-                    callback(factors.map { ["type": $0.type, "usage": $0.usage as Any] })
+                    callback(factors.map { factor in
+                        var payload: [String: Any] = ["type": factor.type]
+                        if let usage = factor.usage {
+                            payload["usage"] = usage
+                        }
+                        return payload
+                    })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

                    callback(factors.map { factor in
                        var payload: [String: Any] = ["type": factor.type]
                        if let usage = factor.usage {
                            payload["usage"] = usage
                        }
                        return payload
                    })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swift`
at line 19, The dictionary being constructed in the callback within
MyAccountGetFactorsMethodHandler.swift has an issue with the "usage" key
assignment. When $0.usage is nil, the Optional wrapper is not a stable Flutter
codec type. Fix this by either conditionally including the "usage" key only when
the value is not nil, or explicitly mapping nil values to NSNull(). Modify the
factors.map closure to handle the optional usage value properly so that nil
values are either omitted from the dictionary or explicitly converted to
NSNull() instead of being wrapped in Optional.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift (1)

18-27: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate preferredAuthenticationMethod when the key is present.

If a non-null preferredAuthenticationMethod is supplied but doesn’t map to the enum, current logic drops it to nil and proceeds. Return an argument-validation error instead.

Suggested fix
-        let preferredAuthenticationMethod =
-            (arguments["preferredAuthenticationMethod"] as? String)
-                .flatMap(PreferredAuthenticationMethod.init(rawValue:))
+        let rawPreferred = arguments["preferredAuthenticationMethod"] as? String
+        let preferredAuthenticationMethod = rawPreferred
+            .flatMap(PreferredAuthenticationMethod.init(rawValue:))
+        if rawPreferred != nil && preferredAuthenticationMethod == nil {
+            return callback(FlutterError(from: .requiredArgumentInvalid("preferredAuthenticationMethod")))
+        }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        let rawPreferred = arguments["preferredAuthenticationMethod"] as? String
        let preferredAuthenticationMethod = rawPreferred
            .flatMap(PreferredAuthenticationMethod.init(rawValue:))
        if rawPreferred != nil && preferredAuthenticationMethod == nil {
            return callback(FlutterError(from: .requiredArgumentInvalid("preferredAuthenticationMethod")))
        }

        client
            .authenticationMethods
            .updateAuthenticationMethod(by: id,
                                        name: name,
                                        preferredAuthenticationMethod: preferredAuthenticationMethod)
            .start {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift`
around lines 18 - 27, The current code in
MyAccountUpdateAuthMethodMethodHandler.swift silently converts an invalid
preferredAuthenticationMethod string to nil instead of validating it. Modify the
logic around line 18-27 to check if the preferredAuthenticationMethod key is
present in the arguments dictionary: if it is present and is a string, validate
that it successfully initializes to a PreferredAuthenticationMethod enum value
using the rawValue initializer; if the string doesn't map to a valid enum case,
return an argument-validation error instead of proceeding with nil; if the key
is absent from arguments, that's acceptable and should result in nil being
passed to the API call.
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift (1)

28-35: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Normalize enum-like argument validation across MyAccount handlers.
Invalid string inputs are currently coerced into fallback behavior (nil/default routing) instead of returning validation errors, which weakens method-channel API contracts.

  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift#L28-L35: remove fallback-to-phone default for unknown factorType; reject unsupported values.
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift#L13-L18: if type is provided but cannot parse, return an invalid-argument FlutterError instead of treating it as no filter.
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift#L18-L27: if preferredAuthenticationMethod key is present and unparsable, return invalid-argument FlutterError.
📍 Affects 3 files
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift#L28-L35 (this comment)
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift#L13-L18
  • auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift#L18-L27
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift`
around lines 28 - 35, Normalize argument validation across three MyAccount
handlers to reject invalid enum-like string values instead of silently falling
back to defaults. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift
(lines 28-35), remove the default case that falls back to confirmPhoneEnrollment
and instead return an invalid-argument FlutterError for unsupported factorType
values. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift
(lines 13-18), add validation to return an invalid-argument FlutterError when
the type parameter is provided but cannot be parsed, instead of treating it as
no filter. In
auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swift
(lines 18-27), add validation to return an invalid-argument FlutterError when
the preferredAuthenticationMethod key is present but the value cannot be parsed
to a valid enum.
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift (1)

1-1: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

All symlinks in auth0_flutter/darwin/Classes/AuthAPI/ contain a miscalculated relative path—all eight files have the same root cause. Each symlink uses ../../auth0_flutter/Sources/auth0_flutter/AuthAPI/[name].swift, but from the auth0_flutter/darwin/Classes/AuthAPI/ directory, only two ../ segments reach auth0_flutter/darwin/, leaving the path one directory short of the root. The extraneous auth0_flutter/ component causes all symlinks to resolve to non-existent targets, breaking Swift Package Manager builds.

Root cause: Relative path should ascend three levels (not two) to reach the project root, then navigate to Sources/auth0_flutter/AuthAPI/. The correct path is ../../../Sources/auth0_flutter/AuthAPI/[name].swift.

All affected files:

  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift#L1: fix to ../../../Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift

[critical_issue]

🔗 Proposed fix: correct symlink targets

Update the symlink targets from ../../auth0_flutter/Sources/auth0_flutter/AuthAPI/[name].swift to ../../../Sources/auth0_flutter/AuthAPI/[name].swift. This can be done with:

#!/bin/bash
cd auth0_flutter/darwin/Classes/AuthAPI/
for file in *.swift; do
  rm "$file"
  ln -s "../../../Sources/auth0_flutter/AuthAPI/$file" "$file"
done

Or by directly replacing the contents of each symlink:

-../../auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift
+../../../Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

[Symbolic link → ../../../Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift]
📍 Affects 8 files
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift#L1-L1 (this comment)
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift#L1-L1
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift#L1-L1
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift#L1-L1
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift#L1-L1
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift#L1-L1
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift#L1-L1
  • auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift#L1-L1
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift` at line 1, All
eight symlink files in the AuthAPI directory have miscalculated relative paths
that ascend only two levels when they need to ascend three levels to reach the
project root. For each affected file, update the symlink target from
`../../auth0_flutter/Sources/auth0_flutter/AuthAPI/[filename].swift` to
`../../../Sources/auth0_flutter/AuthAPI/[filename].swift`. Specifically: in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swift (line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swift`; in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift (line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swift`; in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift`;
in auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift`;
in auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift`;
in
auth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift
(line 1) change to
`../../../Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swift`.

- Updates Package.swift to require Auth0.swift >= 2.21.2 (adds
  updateAuthenticationMethod and other newer APIs used by source files)
- Adds PASSKEYS_PLATFORM Swift define to SPM target so passkey source
  files and test assertions compile correctly under SPM
- Adds explicit Flutter import (#if os(iOS)) to 15 test files that use
  FlutterError without importing Flutter — needed under SPM where types
  are not transitively available from @testable import auth0_flutter
- Updates unit-tests-darwin action to use -workspace (includes Pods.xcodeproj
  so Pods_Runner.framework is built as part of the test build)
- Updates Package.resolved to pin Auth0.swift 2.22.0 for iOS and macOS
- Updates Xcode project files to reflect pod install with SPM enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Swift Package Manager support

2 participants