diff --git a/README.md b/README.md index ca0829f..4d687be 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,22 @@ Update `/web/index.html` in the body tag. ``` +As an alternative, you can avoid the` - --> \ No newline at end of file diff --git a/lib/data/services/auth/web.dart b/lib/data/services/auth/web.dart index e823865..8eff2be 100644 --- a/lib/data/services/auth/web.dart +++ b/lib/data/services/auth/web.dart @@ -5,9 +5,23 @@ import 'impl.dart'; class FBAuth implements FBAuthImpl { final FbApp app; - final _auth = auth(); + Auth _auth; - FBAuth(this.app); + FBAuth(this.app) { + if (apps.isEmpty) { + initializeApp( + apiKey: this.app.apiKey, + authDomain: this.app.authDomain, + databaseURL: this.app.databaseURL, + projectId: this.app.projectId, + storageBucket: this.app.storageBucket, + messagingSenderId: this.app.messagingSenderId, + appId: this.app.appId, + measurementId: this.app.measurementId + ); + } + _auth = auth(); + } Future _setPersistenceWeb(Auth _auth) async { // try {