docs(auth): correct the auth README against the current API - #2496
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the auth/README.md documentation to reflect new minimum requirements (Android SDK 23+, Kotlin 2.0+), API changes requiring an application context in authUIConfiguration, and updated transition animations using togetherWith. The review feedback correctly identifies several issues in the updated Compose code snippets, such as the unavailability of applicationContext inside standalone Composable functions, the incorrect usage of LocalContext.current inside non-composable lambdas, and the need to clarify that registerForActivityResult must be called during initialization.
633858e to
939441b
Compare
russellwheatley
left a comment
There was a problem hiding this comment.
LGTM. The fake controller.start() return value is gone, and the migration section now points at the upgrade guide instead of drifting from it.
The auth README documented an API in several places that never existed.
§AuthFlowControllerand§Low-Level APIboth showedval state = controller.start()returning anAuthStatefrom a coroutine - the realstart()takes an Activity and a request code, returnsUnit, and is deprecated. Both now register anActivityResultLauncherand launchcontroller.createIntent(this), matchingAuthFlowControllerDemoActivity.state.result.userbecamestate.user, sinceAuthState.Success.resultis nullable anduseris the field being reached for.Smaller corrections in the same vein:
MfaChallengeScreenwas passing a non-existentonChallengeCompletewhile omitting the requiredauthandonSuccess;ErrorRecoveryDialogwas missing the requiredstringProvider;FirebaseAuthUI.createwas missing the requiredapp; twoproviders = listOf(...)assignments became theproviders { }block, whose setter is private; andcontextis now set in all 40authUIConfiguration {}examples - the builder requires it and throws without it, and only 3 set it.isCredentialLinkingEnabled,passwordResetActionCodeSettingsandlegacyFetchSignInWithEmailare all read by the library but were documented nowhere, so they are now in the configuration reference. Minimum requirements said SDK 21 and Kotlin 1.9 againstminSdk = 23and Kotlin 2.4, and the version checklist and Compose BOM were stale.§Migration Guideis replaced by a link todocs/upgrade-to-10.0.md. It restated that file's own key-changes list and checklist, the two had drifted apart, and the OKF documentation policy asks for one owning doc per topic.§Screen Transitionsis #2475 absorbed into this PR rather than rewritten here - its two commits are cherry-picked with authorship intact, so the samples are the ones already compiled verbatim against the module. #2475 is closed in favour of this one. The only addition is thecontextline, for consistency with the rest of the file.Maintainer note: Fixes internal CPRN-404
Maintainer note: Refs internal CPRN-427