Skip to content

Commit

Permalink
fix(auth, web): lower SDK minimum version constraint to "3.2.0" (#12369)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Feb 23, 2024
1 parent 2bbe0b0 commit fa412b4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Auth getAuthInstance(App app) {
app.jsObject,
auth_interop.AuthOptions(
errorMap: auth_interop.debugErrorMap,
persistence: persistences.toJS,
persistence: customJSList(persistences),
popupRedirectResolver: auth_interop.browserPopupRedirectResolver,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ external AuthJsImpl getAuth([AppJsImpl? app]);
@JS()
external AuthJsImpl initializeAuth(AppJsImpl app, AuthOptions authOptions);

extension type AuthOptions._(JSObject o) implements JSObject {
external AuthOptions({
JSObject errorMap,
@anonymous
@JS()
@staticInterop
abstract class AuthOptions {
external factory AuthOptions({
JSObject? errorMap,
JSArray? persistence,
JSObject? popupRedirectResolver,
});
external JSObject? get errorMap;
external JSArray? get persistence;
external JSObject? get popupRedirectResolver;
}

@JS('debugErrorMap')
Expand Down Expand Up @@ -359,7 +359,10 @@ extension UserJsImplExtension on UserJsImpl {
///
/// See: <https://firebase.google.com/docs/reference/js/firebase.auth.Auth#.Persistence>
@JS('Persistence')
extension type Persistence._(JSObject _) implements JSObject {
@staticInterop
class Persistence {}

extension PersistenceExtension on Persistence {
external JSString get type;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/firebase_auth_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository: https://github.com/firebase/flutterfire/tree/master/packages/firebas
version: 5.9.5

environment:
sdk: '>=3.3.0 <4.0.0'
sdk: '>=3.2.0 <4.0.0'
flutter: '>=3.3.0'

dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ dynamic jsifyList(
return js.toJSArray(list.map((item) => jsify(item, customJsify)).toList());
}

/// Converts a List into a JS Array without converting the items.
dynamic customJSList(List list) {
return js.toJSArray(list.toList());
}

/// Returns the JS implementation from Dart Object.
///
/// The optional [customJsify] function may return `null` to indicate,
Expand Down

0 comments on commit fa412b4

Please sign in to comment.