diff --git a/apps/rebreak-native/app/(app)/index.tsx b/apps/rebreak-native/app/(app)/index.tsx index 712dd3b..d39d9e7 100644 --- a/apps/rebreak-native/app/(app)/index.tsx +++ b/apps/rebreak-native/app/(app)/index.tsx @@ -80,7 +80,7 @@ export default function HomeScreen() { ); return ( - + onTitleSaved(newTitle), 350); } } @@ -266,10 +270,10 @@ export function MailAccountSettingsSheet({ setLocalError(null); const result = await connect({ email: account.email, password: passwordDraft }); if (result.ok) { - setPasswordDraft(''); - setPasswordVisible(false); - onPasswordSaved(); - setMode('list'); + // Symmetrisch zu handleSaveTitle: Sheet zuerst dismissen, dann nach + // Animation-Complete Parent informieren — sonst Modal-Conflict-Crash. + handleClose(); + setTimeout(() => onPasswordSaved(), 350); } else { setLocalError(result.error ?? t('mail.connect_failed')); } diff --git a/apps/rebreak-native/stores/auth.ts b/apps/rebreak-native/stores/auth.ts index 74d5515..5f52047 100644 --- a/apps/rebreak-native/stores/auth.ts +++ b/apps/rebreak-native/stores/auth.ts @@ -73,6 +73,14 @@ export const useAuthStore = create((set) => ({ signOut: async () => { await supabase.auth.signOut(); + // Google-OAuth-Cookie in SafariViewController/Chrome Custom Tabs leeren, + // sonst springt der nächste Sign-in stillschweigend auf den vorigen Account + // statt den Account-Picker zu zeigen. + try { + await WebBrowser.coolDownAsync(); + } catch { + // ignore + } set({ session: null, user: null }); }, @@ -91,6 +99,9 @@ export const useAuthStore = create((set) => ({ options: { redirectTo: redirectUri, skipBrowserRedirect: true, + // Google: prompt=select_account erzwingt den Account-Picker, + // auch wenn der Browser noch eine aktive Google-Session hat. + ...(provider === 'google' ? { queryParams: { prompt: 'select_account' } } : {}), }, });