From 94f09a332852a7950e768bd5d895655db221f37c Mon Sep 17 00:00:00 2001 From: zsolt Date: Thu, 13 Aug 2026 02:42:54 +0200 Subject: [PATCH] Separate Google account sign-in from calendar authorization --- lib/google_calendar_page.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/google_calendar_page.dart b/lib/google_calendar_page.dart index e32e96b..a6bf855 100644 --- a/lib/google_calendar_page.dart +++ b/lib/google_calendar_page.dart @@ -156,8 +156,9 @@ class _AccountsPageState extends State { await _ensureGoogleInitialized(); initialized = true; } - final account = await googleSignIn.authenticate(scopeHint: calendarScopes); + final account = await googleSignIn.authenticate(); signedInAccount = account; + await account.authorizationClient.authorizeScopes(calendarScopes); await _loadGoogleCalendars(promptIfNecessary: true); } catch (error) { if (!mounted) return; @@ -181,6 +182,11 @@ class _AccountsPageState extends State { 'A bel\u00e9p\u00e9si ablakos m\u0171k\u00f6d\u00e9shez tedd be az android/app/google-services.json f\u00e1jlt, ' 'amely tartalmaz Web application OAuth client ID-t, majd buildeld \u00fajra az APK-t.'; } + if (raw.contains('Account reauth failed')) { + return '$prefix: a Google fi\u00f3k \u00fajrahiteles\u00edt\u00e9se nem siker\u00fclt. ' + 'Pr\u00f3b\u00e1ld meg a tableten a Google fi\u00f3kot friss\u00edteni/bejelentkeztetni a Be\u00e1ll\u00edt\u00e1sokban, ' + 'vagy t\u00f6r\u00f6ld az app Google hozz\u00e1f\u00e9r\u00e9s\u00e9t, majd jelentkezz be \u00fajra.'; + } return '$prefix: $raw'; }