Skip to content

feat(firebase_auth): v1 rework #3140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 11, 2020
Merged

feat(firebase_auth): v1 rework #3140

merged 9 commits into from
Aug 11, 2020

Conversation

Salakar
Copy link
Member

@Salakar Salakar commented Aug 11, 2020


Co-authored-by: @Ehesp
Co-authored-by: @greghesp
Co-authored-by: @helenaford
Co-authored-by: @kirstywilliams
Co-authored-by: @Salakar


NEW DOCUMENTATION.


Description

As part of our on-going work for #2582 this is our finalised Firebase Authentication rework changes.

Overall, Firebase Auth has been heavily reworked to bring it inline with the federated plugin setup along with adding new features, documentation and many more unit and end-to-end tests (tested on Web, Android, iOS & MacOS). The API has mainly been kept the same, however there are some breaking changes.

General

  • BREAKING: The FirebaseUser class has been renamed to User.
  • BREAKING: The AuthResult class has been renamed to UserCredential.
  • NEW: The ActionCodeSettings class is now consumable on all supporting methods.
    • NEW: Added support for the dynamicLinkDomain property.
  • NEW: Added a new FirebaseAuthException class (extends FirebaseException).
    • All errors are now returned as a FirebaseAuthException, allowing you to access the code & message associated with the error.
    • In addition, it is now possible to access the email and credential properties on exceptions if they exist.

FirebaseAuth

  • BREAKING: Accessing the current user via currentUser() is now synchronous via the currentUser getter.
  • BREAKING: isSignInWithEmailLink() is now synchronous.
  • DEPRECATED: FirebaseAuth.fromApp() is now deprecated in favor of FirebaseAuth.instanceFor().
  • DEPRECATED: onAuthStateChanged has been deprecated in favor of authStateChanges().
  • NEW: Added support for idTokenChanges() stream listener.
  • NEW: Added support for userChanges() stream listener.
    • The purpose of this API is to allow users to subscribe to all user events without having to manually hydrate app state in cases where a manual reload was required (e.g. updateProfile()).
  • NEW: Added support for applyActionCode().
  • NEW: Added support for checkActionCode().
  • NEW: Added support for verifyPasswordResetCode().
  • NEW: Added support for accessing the current language code via the languageCode getter.
  • NEW: setLanguageCode() now supports providing a null value.
    • On web platforms, if null is provided the Firebase projects default language will be set.
    • On native platforms, if null is provided the device language will be used.
  • NEW: verifyPhoneNumber() exposes a autoRetrievedSmsCodeForTesting property.
    • This allows developers to test automatic SMS code resolution on Android devices during development.
  • NEW (iOS): appVerificationDisabledForTesting setting can now be set for iOS.
    • This allows developers to skip ReCaptcha verification when testing phone authentication.
  • NEW (iOS): userAccessGroup setting can now be set for iOS & MacOS.
    • This allows developers to share authentication states across multiple apps or extensions on iOS & MacOS. For more information see the Firebase iOS SDK documentation.

User

  • BREAKING: Removed the UpdateUserInfo class when using updateProfile in favor of named arguments.
  • NEW: Added support for getIdTokenResult().
  • NEW: Added support for verifyBeforeUpdateEmail().
  • FIX: Fixed several iOS crashes when the Firebase SDK returned nil property values.
  • FIX: Fixed an issue on Web & iOS where a users email address would still show after unlinking the email/password provider.

UserCredential

  • NEW: Added support for accessing the users AuthCredential via the credential property.

AuthProvider & AuthCredential

  • DEPRECATED: All sub-class (e.g. GoogleAuthProvider) getCredential() methods have been deprecated in favor of credential().
    • DEPRECATED: EmailAuthProvider.getCredentialWithLink() has been deprecated in favor of EmailAuthProvider.credentialWithLink().
  • NEW: Supporting providers can now assign scope and custom request parameters.
    • The scope and parameters will be used on web platforms when triggering a redirect or popup via signInWithPopup() or signInWithRedirect().

Related Issues & PRs

...and more (will be manually linked and closed following merge of this PR).

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

 into @invertase/auth_v1

# Conflicts:
#	packages/firebase_auth/firebase_auth/CHANGELOG.md
#	packages/firebase_auth/firebase_auth/example/lib/signin_page.dart
#	packages/firebase_auth/firebase_auth/example/pubspec.yaml
#	packages/firebase_auth/firebase_auth/pubspec.yaml
@Salakar Salakar marked this pull request as ready for review August 11, 2020 17:20
@Salakar Salakar merged commit 799231a into firebase:master Aug 11, 2020
@firebase firebase locked and limited conversation to collaborators Sep 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants