Authentication Complete
- If this page does not close automatically, switch back to Lazurite.
-
+ Lazurite is finishing sign-in. If it does not reopen automatically, tap the button below.
+
''';
+}
diff --git a/lib/features/connectivity/presentation/connectivity_banner_host.dart b/lib/features/connectivity/presentation/connectivity_banner_host.dart
index d4b38dc..42befc4 100644
--- a/lib/features/connectivity/presentation/connectivity_banner_host.dart
+++ b/lib/features/connectivity/presentation/connectivity_banner_host.dart
@@ -14,15 +14,13 @@ class ConnectivityBannerHost extends StatelessWidget {
return Stack(
children: [
Positioned.fill(child: child),
- Positioned(
- top: 0,
- left: 0,
- right: 0,
- child: SafeArea(
- bottom: false,
- child: AnimatedSlide(
- duration: const Duration(milliseconds: 200),
- offset: state.isOffline ? Offset.zero : const Offset(0, -1),
+ if (state.isOffline)
+ Positioned(
+ top: 0,
+ left: 0,
+ right: 0,
+ child: SafeArea(
+ bottom: false,
child: IgnorePointer(
ignoring: true,
child: Padding(
@@ -59,7 +57,6 @@ class ConnectivityBannerHost extends StatelessWidget {
),
),
),
- ),
],
);
},
diff --git a/test/features/auth/data/auth_repository_test.dart b/test/features/auth/data/auth_repository_test.dart
index e2f55cb..df8045c 100644
--- a/test/features/auth/data/auth_repository_test.dart
+++ b/test/features/auth/data/auth_repository_test.dart
@@ -148,5 +148,27 @@ void main() {
verify(() => mockDatabase.deleteSetting(AppDatabase.activeAccountDidSettingKey)).called(1);
});
});
+
+ group('callback server', () {
+ test('builds a callback page that can return to the app', () {
+ final html = authRepository.buildCallbackPageHtmlForTest();
+
+ expect(html, contains('lazurite://auth-complete'));
+ expect(html, contains('Return to Lazurite'));
+ });
+
+ test('can stop the callback server twice without throwing', () async {
+ final redirectUri = await authRepository.startCallbackServerForTest(Uri.parse('http://127.0.0.1/callback'));
+
+ expect(redirectUri.host, equals('127.0.0.1'));
+ expect(authRepository.callbackPort, greaterThan(0));
+
+ await authRepository.stopCallbackServerForTest();
+ expect(authRepository.callbackPort, equals(0));
+
+ await authRepository.stopCallbackServerForTest();
+ expect(authRepository.callbackPort, equals(0));
+ });
+ });
});
}