open account login within WebLibre

This commit is contained in:
Fabian Freund
2026-06-01 16:07:50 +02:00
parent 0e6624c83d
commit 90716ea419
2 changed files with 3 additions and 12 deletions
@@ -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
@@ -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),