Refactor: Implement sign-out and re-login flow

This commit is contained in:
gpt-engineer-app[bot]
2025-10-14 15:16:49 +00:00
parent 92943f2692
commit 52cad6c4dc
5 changed files with 84 additions and 119 deletions

View File

@@ -18,7 +18,7 @@ import type { OAuthProvider } from '@/types/identity';
interface PasswordSetupDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
onSuccess: () => void;
onSuccess: (email?: string) => void;
provider?: OAuthProvider;
mode?: 'standalone' | 'disconnect';
}
@@ -59,7 +59,13 @@ export function PasswordSetupDialog({
if (result.success) {
setPassword('');
setConfirmPassword('');
onSuccess();
if (result.needsRelogin && result.email) {
// Pass email to parent for redirect handling
onSuccess(result.email);
} else {
onSuccess();
}
onOpenChange(false);
} else {
setError(result.error || 'Failed to set password');