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
fix(firebase_auth): pass Persistence
value to FirebaseAuth.instanceFor(app: app, persistence: persistence)
for setting persistence on Web platform
#9138
Conversation
…base Auth Web initialiser
FirebaseAuth.persistenceType()
for setting persistence on Web platformFirebaseAuth.persistenceType()
for setting persistence on Web platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of doc updates I'll make.
packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart
Outdated
Show resolved
Hide resolved
...ase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart
Outdated
Show resolved
Hide resolved
/// Auth state for applications that are shared by other users or have | ||
/// sensitive data. | ||
/// | ||
/// This is only supported on web based platforms. | ||
Future<void> setPersistence(Persistence persistence) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the Deprecated
annotation here so developers will get notified in their IDE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, do we need to breaking change this straight away? Is it not possible to deprecate but just call the new method instead, and then eventually we can remove the method in a later release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ehesp this is useless now Firebase.instance.setPersistence()
because the value needs to be passed before Firebase.instance
is ever called. We could just deprecate it and keep the implementation but it does nothing. We needed a new API (FirebaseAuth.persistenceType()
) to pass the value on the very first call of initializeAuth()
for web. We felt it made sense to simply remove underlying implementation and throw a deprecation exception so users adopt the new strategy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the PR description, but just to be clear, setPersistence()
is not useless as long as persistence is used to initialize the auth instance here
This comment was marked as off-topic.
This comment was marked as off-topic.
…c/platform_interface/platform_interface_firebase_auth.dart
…terfire into @russell/auth-9117
What about having |
FirebaseAuth.persistenceType()
for setting persistence on Web platformPersistence
value to FirebaseAuth.instanceFor(app: app, persistence: persistence)
for setting persistence on Web platform
…terfire into @russell/auth-9117 � Conflicts: � docs/auth/start.md � packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart
Persistence
value to FirebaseAuth.instanceFor(app: app, persistence: persistence)
for setting persistence on Web platformPersistence
value to FirebaseAuth.instanceFor(app: app, persistence: persistence)
for setting persistence on Web platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will update this doc change after code review.
Persistence
value to FirebaseAuth.instanceFor(app: app, persistence: persistence)
for setting persistence on Web platformPersistence
value to FirebaseAuth.instanceFor(app: app, persistence: persistence)
for setting persistence on Web platform
Description
"persistence" behaviour has changed on the web platform. This PR fixes "persistence" so it locally persists data as it was before web v9 JS SDK update.
This PR also allows a persistence value to be passed on initialising Auth instance
FirebaseAuth.instanceFor(app: app, persistence: persistence)
.Related Issues
fixes #9117
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?