From 90716ea4197c706701b97c7566154d3a406fb211 Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Mon, 1 Jun 2026 16:07:50 +0200 Subject: [PATCH] open account login within WebLibre --- .../account/domain/repositories/account_auth.dart | 13 ++----------- .../widgets/account_auth_status_card.dart | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/apps/weblibre/lib/features/account/domain/repositories/account_auth.dart b/apps/weblibre/lib/features/account/domain/repositories/account_auth.dart index bc2fb2ae..e2f7e83a 100644 --- a/apps/weblibre/lib/features/account/domain/repositories/account_auth.dart +++ b/apps/weblibre/lib/features/account/domain/repositories/account_auth.dart @@ -19,9 +19,9 @@ */ import 'dart:async'; +import 'package:flutter_mozilla_components/flutter_mozilla_components.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:supabase/supabase.dart'; -import 'package:url_launcher/url_launcher.dart'; import 'package:weblibre/core/logger.dart'; import 'package:weblibre/core/providers/device_info.dart'; import 'package:weblibre/features/about/domain/providers.dart'; @@ -222,16 +222,7 @@ class AccountAuthRepository extends _$AccountAuthRepository { final baseUri = Uri.parse(SupabaseConfig.accountWebUrl); final uri = baseUri.replace(queryParameters: queryParams); - final launched = await launchUrl(uri, mode: LaunchMode.inAppBrowserView); - if (!launched) { - state = AsyncData( - _currentOrEmpty.copyWith( - status: AccountAuthStatus.error, - lastError: 'Could not open sign-in page', - ), - ); - return; - } + await GeckoBrowserService().openInCustomTab(url: uri, private: false); // Set the timer last so any earlier error path doesn't have to think // about cancelling a timer it never started. Guard the body so that a diff --git a/apps/weblibre/lib/features/account/presentation/widgets/account_auth_status_card.dart b/apps/weblibre/lib/features/account/presentation/widgets/account_auth_status_card.dart index e25a7104..400f0477 100644 --- a/apps/weblibre/lib/features/account/presentation/widgets/account_auth_status_card.dart +++ b/apps/weblibre/lib/features/account/presentation/widgets/account_auth_status_card.dart @@ -76,7 +76,7 @@ class _SigningInTile extends ConsumerWidget { const Text('Signing in...'), const SizedBox(height: 8), Text( - 'Complete sign-in in your browser', + 'Complete sign-in in WebLibre', style: Theme.of(context).textTheme.bodySmall, ), const SizedBox(height: 16),