feat: Swift Package Manager dependency support for Flutter iOS/macOS SDK#804
feat: Swift Package Manager dependency support for Flutter iOS/macOS SDK#804NandanPrabhu wants to merge 13 commits into
Conversation
29e7c3d to
4128680
Compare
fd7f369 to
d3b8c46
Compare
d3b8c46 to
035c772
Compare
8e2281b to
45d2569
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (21)
📒 Files selected for processing (1)
WalkthroughMigrates the Darwin plugin from CocoaPods/Ruby to Swift Package Manager by adding a ChangesSwift Package Manager Migration
MyAccountAPI MFA Handler Suite
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
| @@ -1 +0,0 @@ | |||
| ../../../darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift No newline at end of file | |||
There was a problem hiding this comment.
do we need to delete this file?
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".
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (112)
auth0_flutter/example/android/gradle.propertiesis excluded by!**/example/**auth0_flutter/example/android/settings.gradleis excluded by!**/example/**auth0_flutter/example/ios/Gemfileis excluded by!**/example/**auth0_flutter/example/ios/Gemfile.lockis excluded by!**/*.lock,!**/example/**,!**/*.lockauth0_flutter/example/ios/Podfileis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolvedis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/example/**auth0_flutter/example/ios/Runner/AppDelegate.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPISpies.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerGetMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHasValidMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSSOCredentialsMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSpies.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/Mocks.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/SwiftAuth0FlutterPluginTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/WebAuth/WebAuthExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/WebAuth/WebAuthHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/lib/example_app.dartis excluded by!**/example/**auth0_flutter/example/macos/Podfileis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolvedis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcschemeis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/example/**auth0_flutter/example/macos/Runner/AppDelegate.swiftis excluded by!**/example/**auth0_flutter/ios/Classes/Auth0FlutterPlugin.his excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/Auth0FlutterPlugin.mis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/SSOExchangeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerModels.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/DPoP/DPoPClearKeyMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/DPoP/DPoPHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/Extensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/HandlerError.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/MethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/Models.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/Properties.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/SwiftAuth0FlutterPlugin.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/WebAuth/WebAuthExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/WebAuth/WebAuthHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/WebAuth/WebAuthLoginMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/WebAuth/WebAuthModels.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/macos/Classes/Auth0FlutterPlugin.his excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/Auth0FlutterPlugin.mis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/SSOExchangeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerModels.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/DPoP/DPoPClearKeyMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/DPoP/DPoPHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/Extensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/HandlerError.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/MethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/Models.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/Properties.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/SwiftAuth0FlutterPlugin.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/WebAuth/WebAuthExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/WebAuth/WebAuthHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/WebAuth/WebAuthLoginMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/WebAuth/WebAuthModels.swiftis 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.gitignoreauth0_flutter/README.mdauth0_flutter/darwin/.gitignoreauth0_flutter/darwin/Classes/Auth0FlutterPlugin.hauth0_flutter/darwin/Classes/Auth0FlutterPlugin.mauth0_flutter/darwin/auth0_flutter.podspecauth0_flutter/darwin/auth0_flutter/Package.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Auth0FlutterPlugin.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/DPoP/DPoPHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Extensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/HandlerError.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Models.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/Properties.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/WebAuth/WebAuthModels.swiftauth0_flutter/ios/.gitignoreauth0_flutter/ios/Assets/.gitkeepauth0_flutter/ios/auth0_flutter.podspecauth0_flutter/macos/.gitignoreauth0_flutter/macos/Assets/.gitkeepauth0_flutter/macos/auth0_flutter.podspecscripts/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
| 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: | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (13)
auth0_flutter/example/macos/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**
📒 Files selected for processing (107)
auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/auth0_flutter.podspecauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swiftauth0_flutter/ios/.gitignoreauth0_flutter/macos/.gitignore
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (13)
auth0_flutter/example/macos/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**
📒 Files selected for processing (107)
auth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/auth0_flutter.podspecauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swiftauth0_flutter/ios/.gitignoreauth0_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.swiftRepository: auth0/auth0-flutter
Length of output: 295
🏁 Script executed:
cat auth0_flutter/darwin/auth0_flutter/Package.swiftRepository: 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 allows2.18.0and 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 winValidate 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: replaceif/elsefallback with explicitswitchfor supported factor types and returnFlutterErrorfor unsupported values.auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift#L20-L20: accept only"sms"/"voice"and returnFlutterErrorfor anything else.auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swift#L28-L35: explicitly map supported OTP factor types and returnFlutterErroron 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-L20auth0_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 winReject invalid
typevalues instead of widening the query.Line 13-Line 15 converts unknown
typevalues tonil, and Line 18 then fetches all authentication methods. That silently turns malformed input into a broader read path. Return aFlutterErrorwhentypeis 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 winFail fast on invalid
preferredAuthenticationMethodvalues.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.
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (35)
auth0_flutter/example/android/gradle.propertiesis excluded by!**/example/**auth0_flutter/example/android/settings.gradleis excluded by!**/example/**auth0_flutter/example/ios/Gemfileis excluded by!**/example/**auth0_flutter/example/ios/Gemfile.lockis excluded by!**/*.lock,!**/example/**,!**/*.lockauth0_flutter/example/ios/Podfileis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/example/**auth0_flutter/example/ios/Runner/AppDelegate.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPISpies.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerGetMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHasValidMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSSOCredentialsMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSpies.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/Mocks.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/WebAuth/WebAuthExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/WebAuth/WebAuthHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/macos/Podfileis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/example/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis 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.gitignoreauth0_flutter/README.mdauth0_flutter/darwin/.gitignoreauth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/auth0_flutter.podspecauth0_flutter/darwin/auth0_flutter/Package.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swiftauth0_flutter/ios/.gitignoreauth0_flutter/macos/.gitignorescripts/generate-symlinks.sh
💤 Files with no reviewable changes (2)
- .github/workflows/check-symlinks.yml
- scripts/generate-symlinks.sh
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (35)
auth0_flutter/example/android/gradle.propertiesis excluded by!**/example/**auth0_flutter/example/android/settings.gradleis excluded by!**/example/**auth0_flutter/example/ios/Gemfileis excluded by!**/example/**auth0_flutter/example/ios/Gemfile.lockis excluded by!**/*.lock,!**/example/**,!**/*.lockauth0_flutter/example/ios/Podfileis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/example/**auth0_flutter/example/ios/Runner/AppDelegate.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPIHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/AuthAPI/AuthAPISpies.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerGetMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerHasValidMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSSOCredentialsMethodHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/CredentialsManager/CredentialsManagerSpies.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/Mocks.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/WebAuth/WebAuthExtensionsTests.swiftis excluded by!**/example/**auth0_flutter/example/ios/Tests/WebAuth/WebAuthHandlerTests.swiftis excluded by!**/example/**auth0_flutter/example/macos/Podfileis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcodeproj/project.pbxprojis excluded by!**/example/**auth0_flutter/example/macos/Runner.xcworkspace/contents.xcworkspacedatais excluded by!**/example/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/ios/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/ios/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftis excluded by!auth0_flutter/macos/Classes/**auth0_flutter/macos/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftis 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.gitignoreauth0_flutter/README.mdauth0_flutter/darwin/.gitignoreauth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPICustomTokenExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIEmailPasswordlessLoginMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyCredentialExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyExtensions.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeyLoginChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPasskeySignupChallengeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIPhoneNumberPasswordlessLoginMethod.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIRenewMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIResetPasswordMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPISignupMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/SSOExchangeMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/ClearApiCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerClearMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerExtensions.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerGetMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerHasValidMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerModels.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerRenewMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerSaveMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/CredentialsManagerUserInfoMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/CredentialsManager/SSOCredentialsMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPClearKeyMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPGetHeadersMethodHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/DPoP/DPoPHandler.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/Extensions.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/HandlerError.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/MethodHandler.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Models.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/Properties.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthExtensions.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLoginMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthLogoutMethodHandler.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/Classes/WebAuth/WebAuthModels.swiftauth0_flutter/darwin/auth0_flutter.podspecauth0_flutter/darwin/auth0_flutter/Package.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountConfirmEnrollmentMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountDeleteAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollEmailMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyChallengeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPasskeyMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPushMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollRecoveryCodeMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollTotpMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountExtensions.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetFactorsMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountUpdateAuthMethodMethodHandler.swiftauth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountVerifyOtpMethodHandler.swiftauth0_flutter/ios/.gitignoreauth0_flutter/macos/.gitignorescripts/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 winReject 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 theif/elsefallback with an explicitswitchon allowed values ("push-notification","recovery-code") and return aFlutterErrorfor unsupportedfactorType.auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountEnrollPhoneMethodHandler.swift#L20-L20: At Line 20, map only"sms"and"voice"; return aFlutterErrorfor unsupportedtypeinstead 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 winReject unsupported
typevalues instead of silently widening results.When
typeis provided but invalid, it currently degrades toniland 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 winAvoid encoding
Optional.noneinto Flutter channel payloads.
"usage": $0.usage as Anycan emit an Optional wrapper value whenusageis nil, which is not a stable Flutter codec payload type. Omit the key when nil (or map explicitly toNSNull()).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 winValidate
preferredAuthenticationMethodwhen the key is present.If a non-null
preferredAuthenticationMethodis supplied but doesn’t map to the enum, current logic drops it toniland 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 winNormalize 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 unknownfactorType; reject unsupported values.auth0_flutter/darwin/auth0_flutter/Sources/auth0_flutter/MyAccountAPI/MyAccountGetAuthMethodsMethodHandler.swift#L13-L18: iftypeis 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: ifpreferredAuthenticationMethodkey 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-L18auth0_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 winAll 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 theauth0_flutter/darwin/Classes/AuthAPI/directory, only two../segments reachauth0_flutter/darwin/, leaving the path one directory short of the root. The extraneousauth0_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.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIHandler.swift#L1: fix to../../../Sources/auth0_flutter/AuthAPI/AuthAPIHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift#L1: fix to../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift#L1: fix to../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithEmailMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift#L1: fix to../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithOTPMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift#L1: fix to../../../Sources/auth0_flutter/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swiftauth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift#L1: fix to../../../Sources/auth0_flutter/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swiftauth0_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].swiftto../../../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" doneOr 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-L1auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginUsernameOrEmailMethodHandler.swift#L1-L1auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithEmailMethodHandler.swift#L1-L1auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithOTPMethodHandler.swift#L1-L1auth0_flutter/darwin/Classes/AuthAPI/AuthAPILoginWithPhoneNumberMethodHandler.swift#L1-L1auth0_flutter/darwin/Classes/AuthAPI/AuthAPIMultifactorChallengeMethodHandler.swift#L1-L1auth0_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
📋 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
auth0_flutter/darwin/auth0_flutter/Package.swiftdeclaring theauth0_flutterSPM 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.auth0_flutter.podspecsource_filesto point at the new sharedSources/auth0_flutterlayout; version pins kept in sync withPackage.swift.Sources/auth0_flutter, relying onsharedDarwinSource: true(declared inpubspec.yaml) so iOS and macOS build from a single source tree.Removed symlink machinery
scripts/generate-symlinks.shand thecheck-symlinksworkflow —sharedDarwinSourcereplaces the per-platform symlink approach.auth0_flutter/iosandauth0_flutter/macossymlinked source trees.Plugin entry point
Auth0FlutterPlugin.h/.m) and renames the Swift plugin classSwiftAuth0FlutterPlugin→Auth0FlutterPluginto match thepluginClassalready declared inpubspec.yaml. No public Dart API change.Example app
Podfile, workspace) to SPM (Package.resolved, project-based build).AppDelegateadopts@main+applicationSupportsSecureRestorableState.CI
setup-darwin: drops the Ruby/Bundler andpod installsteps; 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 againstRunner.xcodeprojinstead of the (now removed) workspace..xcresultto Cobertura XML viaxcresultparser(Ruby-free) before the Codecov upload, replacing the removedslatherstep. The orphanedexample/ios/Gemfile/Gemfile.lock(slather only) are deleted.Tests
Auth0FlutterPluginTests.credentialsManager.store(credentials:)instead of hand-builtNSKeyedArchiverfixtures.📎 References
🎯 Testing
xcodebuildagainstRunner.xcodeproj(Xcode 26.2); Android and Windows unit suites unchanged.auth0_flutter/example, runflutter config --enable-swift-package-managerthenflutter build ios/flutter build macosand exercise login/logout, credentials manager, and DPoP flows.Summary by CodeRabbit
New Features
Documentation
Chores