Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🐛 fix(desktop): make the connection drawer a status panel instead of a sign-in wizard (#17943)

Inneid791e026faf0
diff --git a/locales/en-US/desktop-onboarding.json b/locales/en-US/desktop-onboarding.json
index b9db5fea8b4..5e23cf1c0b8 100644
--- a/locales/en-US/desktop-onboarding.json
+++ b/locales/en-US/desktop-onboarding.json
@@ -1,8 +1,6 @@
{
"authResult.failed.desc": "Please try again or switch to a different sign-in method",
"authResult.failed.title": "Authorization Failed",
- "authResult.success.desc": "Please click the Start button below to continue using LobeHub Desktop",
- "authResult.success.title": "Authorization Successful",
"back": "Back",
"navigation.next": "Continue",
"next": "Next",
@@ -61,6 +59,7 @@
"screen5.actions.cancel": "Cancel",
"screen5.actions.connectToServer": "Connect to Server",
"screen5.actions.connecting": "Connecting...",
+ "screen5.actions.done": "Done",
"screen5.actions.signInCloud": "Sign in to LobeHub Cloud",
"screen5.actions.signOut": "Sign out",
"screen5.actions.signingIn": "Signing in...",
@@ -81,6 +80,10 @@
"screen5.methods.selfhost.name": "Self-hosted Instance",
"screen5.navigation.next": "Get Started",
"screen5.selfhost.endpointPlaceholder": "Enter your server URL (e.g., https://your-server.com)",
+ "screen5.status.cloud.title": "Connected to LobeHub Cloud",
+ "screen5.status.description": "Agents, Groups, settings, and Context are syncing across all your devices.",
+ "screen5.status.selfhost.description": "Syncing Agents, Groups, settings, and Context with {{url}}.",
+ "screen5.status.selfhost.title": "Connected to your own server",
"screen5.title": "Sign in to sync across devices",
"screen5.title2": "Keep your data synchronized everywhere",
"screen5.title3": "Your data stays in your control"
diff --git a/locales/zh-CN/desktop-onboarding.json b/locales/zh-CN/desktop-onboarding.json
index ab4e8273e55..42d4134540b 100644
--- a/locales/zh-CN/desktop-onboarding.json
+++ b/locales/zh-CN/desktop-onboarding.json
@@ -1,8 +1,6 @@
{
"authResult.failed.desc": "请重试,或切换其他登录方式",
"authResult.failed.title": "授权失败",
- "authResult.success.desc": "点击下方「开始」继续使用 LobeHub 桌面端",
- "authResult.success.title": "授权成功",
"back": "返回",
"navigation.next": "继续",
"next": "下一步",
@@ -61,8 +59,9 @@
"screen5.actions.cancel": "取消",
"screen5.actions.connectToServer": "连接服务器",
"screen5.actions.connecting": "正在连接…",
+ "screen5.actions.done": "完成",
"screen5.actions.signInCloud": "登录 LobeHub Cloud",
- "screen5.actions.signOut": "返回并退出登录",
+ "screen5.actions.signOut": "退出登录",
"screen5.actions.signingIn": "正在登录…",
"screen5.actions.signingOut": "正在退出…",
"screen5.actions.tryAgain": "重试",
@@ -81,6 +80,10 @@
"screen5.methods.selfhost.name": "自托管实例",
"screen5.navigation.next": "开始使用",
"screen5.selfhost.endpointPlaceholder": "请输入您的服务器地址(例如:https://your-server.com)",
+ "screen5.status.cloud.title": "已连接到 LobeHub Cloud",
+ "screen5.status.description": "代理、群组、设置和上下文正在所有设备间同步。",
+ "screen5.status.selfhost.description": "正在与 {{url}} 同步代理、群组、设置和上下文。",
+ "screen5.status.selfhost.title": "已连接到自托管实例",
"screen5.title": "登录以实现跨设备同步",
"screen5.title2": "让您的数据随处同步",
"screen5.title3": "您的数据始终由您掌控"
diff --git a/packages/locales/src/default/desktop-onboarding.ts b/packages/locales/src/default/desktop-onboarding.ts
index b9b41e5a83e..38f96c5022e 100644
--- a/packages/locales/src/default/desktop-onboarding.ts
+++ b/packages/locales/src/default/desktop-onboarding.ts
@@ -1,9 +1,6 @@
export default {
'authResult.failed.desc': 'Please try again or switch to a different sign-in method',
'authResult.failed.title': 'Authorization Failed',
- 'authResult.success.desc':
- 'Please click the Start button below to continue using LobeHub Desktop',
- 'authResult.success.title': 'Authorization Successful',
'back': 'Back',
'navigation.next': 'Continue',
@@ -76,6 +73,7 @@ export default {
'screen5.actions.cancel': 'Cancel',
'screen5.actions.connectToServer': 'Connect to Server',
'screen5.actions.connecting': 'Connecting...',
+ 'screen5.actions.done': 'Done',
'screen5.actions.signInCloud': 'Sign in to LobeHub Cloud',
'screen5.actions.signOut': 'Sign out',
'screen5.actions.signingIn': 'Signing in...',
@@ -99,6 +97,12 @@ export default {
'screen5.methods.selfhost.name': 'Self-hosted Instance',
'screen5.navigation.next': 'Get Started',
'screen5.selfhost.endpointPlaceholder': 'Enter your server URL (e.g., https://your-server.com)',
+ 'screen5.status.cloud.title': 'Connected to LobeHub Cloud',
+ 'screen5.status.description':
+ 'Agents, Groups, settings, and Context are syncing across all your devices.',
+ 'screen5.status.selfhost.description':
+ 'Syncing Agents, Groups, settings, and Context with {{url}}.',
+ 'screen5.status.selfhost.title': 'Connected to your own server',
'screen5.title': 'Sign in to sync across devices',
'screen5.title2': 'Keep your data synchronized everywhere',
'screen5.title3': 'Your data stays in your control',
diff --git a/src/features/Electron/connection/Connection.tsx b/src/features/Electron/connection/Connection.tsx
index 6c0fb6e6a5e..016ae0b9aa8 100644
--- a/src/features/Electron/connection/Connection.tsx
+++ b/src/features/Electron/connection/Connection.tsx
@@ -53,7 +53,7 @@ const Connection = () => {
>
<Center style={{ height: '100%', overflow: 'auto', padding: 24 }}>
<Flexbox style={{ maxWidth: 560, width: '100%' }}>
- <LoginStep onBack={handleClose} onNext={handleClose} />
+ <LoginStep mode={'status'} onBack={handleClose} onNext={handleClose} />
</Flexbox>
</Center>
</Suspense>
diff --git a/src/features/User/UserPanel/PanelContent.tsx b/src/features/User/UserPanel/PanelContent.tsx
index b4847d95b45..4024bd27ff0 100644
--- a/src/features/User/UserPanel/PanelContent.tsx
+++ b/src/features/User/UserPanel/PanelContent.tsx
@@ -8,8 +8,7 @@ import UserPanelWorkspaceSection from '@/business/client/features/User/UserPanel
import Menu, { type MenuProps } from '@/components/Menu';
import { isDesktop } from '@/const/version';
import UserInfo from '@/features/User/UserInfo';
-import { navigateToDesktopOnboarding } from '@/routes/(desktop)/desktop-onboarding/navigation';
-import { DesktopOnboardingScreen } from '@/routes/(desktop)/desktop-onboarding/types';
+import { useSignOut } from '@/hooks/useSignOut';
import { serverConfigSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useUserStore } from '@/store/user';
import { authSelectors } from '@/store/user/selectors';
@@ -19,42 +18,20 @@ import { useMenu } from './useMenu';
const PanelContent: FC<{ closePopover: () => void }> = ({ closePopover }) => {
const isLoginWithAuth = useUserStore(authSelectors.isLoginWithAuth);
- const [openSignIn, signOut] = useUserStore((s) => [s.openLogin, s.logout]);
+ const openSignIn = useUserStore((s) => s.openLogin);
const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
const { mainItems, logoutItems } = useMenu();
+ const signOut = useSignOut();
const handleSignIn = () => {
openSignIn();
closePopover();
};
- const handleSignOut = async () => {
- if (isDesktop) {
- closePopover();
-
- try {
- const { remoteServerService } = await import('@/services/electron/remoteServer');
- await remoteServerService.clearRemoteServerConfig();
- } catch (error) {
- console.error(error);
- } finally {
- signOut();
- navigateToDesktopOnboarding(DesktopOnboardingScreen.Login);
- }
- return;
- }
-
- signOut();
- closePopover();
- };
-
const handleMenuClick: MenuProps['onClick'] = ({ key }) => {
- if (key === 'logout') {
- void handleSignOut();
- return;
- }
-
closePopover();
+
+ if (key === 'logout') void signOut();
};
return (
diff --git a/src/hooks/useSignOut.ts b/src/hooks/useSignOut.ts
new file mode 100644
index 00000000000..6365cd67b25
--- /dev/null
+++ b/src/hooks/useSignOut.ts
@@ -0,0 +1,29 @@
+import { useCallback } from 'react';
+
+import { isDesktop } from '@/const/version';
+import { navigateToDesktopOnboarding } from '@/routes/(desktop)/desktop-onboarding/navigation';
+import { DesktopOnboardingScreen } from '@/routes/(desktop)/desktop-onboarding/types';
+import { useUserStore } from '@/store/user';
+
+export const useSignOut = () => {
+ const signOut = useUserStore((s) => s.logout);
+
+ return useCallback(async () => {
+ if (!isDesktop) {
+ signOut();
+ return;
+ }
+
+ try {
+ // Must clear the remote server config: the main process holds encrypted OIDC
+ // tokens that survive a plain store logout.
+ const { remoteServerService } = await import('@/services/electron/remoteServer');
+ await remoteServerService.clearRemoteServerConfig();
+ } catch (error) {
+ console.error(error);
+ } finally {
+ signOut();
+ navigateToDesktopOnboarding(DesktopOnboardingScreen.Login);
+ }
+ }, [signOut]);
+};
diff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx
index d67d8c65ab7..6d955620263 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx
@@ -13,6 +13,8 @@ const mockElectronState = vi.hoisted(() => ({
useDataSyncConfig: vi.fn(() => ({})),
}));
+const mockSignOut = vi.hoisted(() => vi.fn());
+
vi.mock('@lobechat/electron-client-ipc', () => ({
useWatchBroadcast: vi.fn(),
}));
@@ -69,31 +71,42 @@ vi.mock('antd-style', async (importOriginal) => {
vi.mock('react-i18next', () => ({
useTranslation: () => ({
- t: (key: string, fallback?: string) =>
- (
- ({
- 'authResult.failed.desc': 'Authorization failed',
- 'authResult.failed.title': 'Authorization Failed',
- 'authResult.success.desc':
- 'Please click the Start button below to continue using LobeHub Desktop',
- 'authResult.success.title': 'Authorization Successful',
- 'back': 'Back',
- 'next': 'Next',
- 'screen5.actions.cancel': 'Cancel',
- 'screen5.actions.connectToServer': 'Connect to server',
- 'screen5.actions.signInCloud': 'Sign in Cloud',
- 'screen5.actions.tryAgain': 'Try again',
- 'screen5.description':
- 'Sign in to sync Agents, Groups, settings, and Context across all devices.',
- 'screen5.methods.selfhost.description': 'Use self-hosted server',
- 'screen5.selfhost.endpointPlaceholder': 'https://example.com',
- 'screen5.title': 'Sign in to sync across devices',
- 'screen5.title2': '',
- 'screen5.title3': '',
- }) as Record<string, string>
- )[key] ||
- fallback ||
- key,
+ t: (key: string, options?: string | Record<string, string>) => {
+ const dict: Record<string, string> = {
+ 'authResult.failed.desc': 'Authorization failed',
+ 'authResult.failed.title': 'Authorization Failed',
+ // Retired key, kept so the "no success banner" assertion below can still fail loudly
+ 'authResult.success.title': 'Authorization Successful',
+ 'back': 'Back',
+ 'next': 'Next',
+ 'screen5.actions.cancel': 'Cancel',
+ 'screen5.actions.connectToServer': 'Connect to server',
+ 'screen5.actions.done': 'Done',
+ 'screen5.actions.signInCloud': 'Sign in Cloud',
+ 'screen5.actions.signOut': 'Sign out',
+ 'screen5.actions.tryAgain': 'Try again',
+ 'screen5.description':
+ 'Sign in to sync Agents, Groups, settings, and Context across all devices.',
+ 'screen5.methods.selfhost.description': 'Use self-hosted server',
+ 'screen5.selfhost.endpointPlaceholder': 'https://example.com',
+ 'screen5.status.cloud.title': 'Connected to LobeHub Cloud',
+ 'screen5.status.description': 'Everything is syncing across all your devices.',
+ 'screen5.status.selfhost.description': 'Syncing with {{url}}.',
+ 'screen5.status.selfhost.title': 'Connected to your own server',
+ 'screen5.title': 'Sign in to sync across devices',
+ 'screen5.title2': '',
+ 'screen5.title3': '',
+ };
+
+ const template = dict[key] ?? (typeof options === 'string' ? options : key);
+
+ if (!options || typeof options === 'string') return template;
+
+ return Object.entries(options).reduce(
+ (acc, [name, value]) => acc.replaceAll(`{{${name}}}`, value),
+ template,
+ );
+ },
}),
}));
@@ -112,6 +125,10 @@ vi.mock('@/hooks/useIMECompositionEvent', () => ({
}),
}));
+vi.mock('@/hooks/useSignOut', () => ({
+ useSignOut: () => mockSignOut,
+}));
+
vi.mock('@/services/electron/remoteServer', () => ({
remoteServerService: {
cancelAuthorization: vi.fn(),
@@ -141,10 +158,14 @@ vi.mock('../components/LobeMessage', () => ({
),
}));
-const renderLoginStep = async () => {
+const renderLoginStep = async (props: { mode?: 'onboarding' | 'status' } = {}) => {
const { default: LoginStep } = await import('./LoginStep');
+ const onBack = vi.fn();
+ const onNext = vi.fn();
+
+ render(<LoginStep onBack={onBack} onNext={onNext} {...props} />);
- render(<LoginStep onBack={vi.fn()} onNext={vi.fn()} />);
+ return { onBack, onNext };
};
beforeEach(() => {
@@ -155,6 +176,8 @@ beforeEach(() => {
mockElectronState.refreshServerConfig.mockClear();
mockElectronState.remoteServerSyncError = undefined;
mockElectronState.useDataSyncConfig.mockClear();
+ mockSignOut.mockClear();
+ mockSignOut.mockResolvedValue(undefined);
});
afterEach(() => {
@@ -162,22 +185,57 @@ afterEach(() => {
});
describe('Desktop onboarding LoginStep', () => {
- it('renders a focused success state and returns to login methods without duplicate auth UI', async () => {
+ it('renders a focused success state without an authorization banner', async () => {
await renderLoginStep();
- expect(screen.getByText('Authorization Successful')).toBeInTheDocument();
- expect(
- screen.queryByText('Please click the Start button below to continue using LobeHub Desktop'),
- ).not.toBeInTheDocument();
+ expect(screen.queryByText('Authorization Successful')).not.toBeInTheDocument();
expect(screen.getByText('User Info')).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Next' })).toBeInTheDocument();
expect(screen.queryByText('OR')).not.toBeInTheDocument();
expect(screen.queryByText('Use self-hosted server')).not.toBeInTheDocument();
+ });
+
+ it('leaves the success state through the host in onboarding mode instead of resetting to the chooser', async () => {
+ const { onBack } = await renderLoginStep();
fireEvent.click(screen.getByRole('button', { name: 'Back' }));
- expect(screen.queryByText('Authorization Successful')).not.toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Sign in Cloud' })).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Use self-hosted server' })).toBeInTheDocument();
+ expect(onBack).toHaveBeenCalledTimes(1);
+ expect(screen.queryByRole('button', { name: 'Sign in Cloud' })).not.toBeInTheDocument();
+ expect(screen.getByText('User Info')).toBeInTheDocument();
+ });
+
+ it('renders a connection summary instead of the sign-in wizard in status mode', async () => {
+ const { onNext } = await renderLoginStep({ mode: 'status' });
+
+ expect(screen.getByText('Connected to LobeHub Cloud')).toBeInTheDocument();
+ expect(screen.getByText('Everything is syncing across all your devices.')).toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: 'Back' })).not.toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: 'Next' })).not.toBeInTheDocument();
+
+ fireEvent.click(screen.getByRole('button', { name: 'Done' }));
+ expect(onNext).toHaveBeenCalledTimes(1);
+ });
+
+ it('names the self-hosted server it is connected to in status mode', async () => {
+ mockElectronState.dataSyncConfig = {
+ active: true,
+ remoteServerUrl: 'https://my-server.example.com',
+ storageMode: 'selfHost',
+ };
+
+ await renderLoginStep({ mode: 'status' });
+
+ expect(screen.getByText('Connected to your own server')).toBeInTheDocument();
+ expect(screen.getByText('Syncing with https://my-server.example.com.')).toBeInTheDocument();
+ });
+
+ it('signs out through the shared flow in status mode rather than faking a logged-out screen', async () => {
+ await renderLoginStep({ mode: 'status' });
+
+ fireEvent.click(screen.getByRole('button', { name: 'Sign out' }));
+
+ expect(mockSignOut).toHaveBeenCalledTimes(1);
+ expect(screen.queryByRole('button', { name: 'Sign in Cloud' })).not.toBeInTheDocument();
});
});
diff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
index b17e1c4fac3..a76e0f13d56 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
@@ -6,7 +6,7 @@ import { Alert, Center, Flexbox, Icon, Input, Text } from '@lobehub/ui';
import { Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar } from 'antd-style';
-import { Cloud, Server, Undo2Icon } from 'lucide-react';
+import { Cloud, LogOutIcon, Server, Undo2Icon } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import urlJoin from 'url-join';
@@ -15,6 +15,7 @@ import { OFFICIAL_SITE } from '@/const/url';
import { isDesktop } from '@/const/version';
import UserInfo from '@/features/User/UserInfo';
import { useIMECompositionEvent } from '@/hooks/useIMECompositionEvent';
+import { useSignOut } from '@/hooks/useSignOut';
import { remoteServerService } from '@/services/electron/remoteServer';
import { electronSystemService } from '@/services/electron/system';
import { useElectronStore } from '@/store/electron';
@@ -55,19 +56,24 @@ const loginMethodMetas = {
},
} as const satisfies Record<LoginMethod, unknown>;
+// `status` hosts render this step as a connection panel for already-signed-in users,
+// where the wizard's "back" and "next" have no meaning.
+type LoginStepMode = 'onboarding' | 'status';
+
interface LoginStepProps {
+ mode?: LoginStepMode;
onBack: () => void;
onNext: () => void;
}
-const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
+const LoginStep = memo<LoginStepProps>(({ mode = 'onboarding', onBack, onNext }) => {
const { t } = useTranslation('desktop-onboarding');
const [endpoint, setEndpoint] = useState('');
const [cloudLoginStatus, setCloudLoginStatus] = useState<LoginStatus>('idle');
const [authProgress, setAuthProgress] = useState<AuthorizationProgress | null>(null);
const [selfhostLoginStatus, setSelfhostLoginStatus] = useState<LoginStatus>('idle');
const [pendingLoginMethod, setPendingLoginMethod] = useState<LoginMethod | null>(null);
- const [isSuccessDismissed, setIsSuccessDismissed] = useState(false);
+ const [isSigningOut, setIsSigningOut] = useState(false);
const [remoteError, setRemoteError] = useState<string | null>(null);
const [showEndpoint, setShowEndpoint] = useState(false);
const [hasLegacyLocalDb, setHasLegacyLocalDb] = useState(false);
@@ -92,6 +98,8 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
s.clearRemoteServerSyncError,
]);
+ const signOut = useSignOut();
+
useDataSyncConfig();
useEffect(() => {
@@ -132,10 +140,9 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
: null;
const hasLocalLoginResult = cloudLoginStatus !== 'idle' || selfhostLoginStatus !== 'idle';
- const successLoginMethod = isSuccessDismissed
- ? null
- : (statusSuccessLoginMethod ??
- (!hasLocalLoginResult && !pendingLoginMethod ? authorizedLoginMethod : null));
+ const successLoginMethod =
+ statusSuccessLoginMethod ??
+ (!hasLocalLoginResult && !pendingLoginMethod ? authorizedLoginMethod : null);
// Determine if user can proceed (either method succeeding is sufficient)
const canStart = () => {
@@ -153,7 +160,6 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
setRemoteError(null);
clearRemoteServerSyncError();
setPendingLoginMethod('cloud');
- setIsSuccessDismissed(false);
setCloudLoginStatus('loading');
setSelfhostLoginStatus('idle');
setDesktopAutoOidcFirstOpenHandled();
@@ -177,21 +183,18 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
setRemoteError(null);
clearRemoteServerSyncError();
setPendingLoginMethod('selfhost');
- setIsSuccessDismissed(false);
setCloudLoginStatus('idle');
setSelfhostLoginStatus('loading');
await connectRemoteServer({ remoteServerUrl: url, storageMode: 'selfHost' });
};
- const handleBackToLoginMethods = (method: LoginMethod) => {
- setIsSuccessDismissed(true);
- setPendingLoginMethod(null);
- setCloudLoginStatus('idle');
- setSelfhostLoginStatus('idle');
- setAuthProgress(null);
- setRemoteError(null);
- clearRemoteServerSyncError();
- setShowEndpoint(method === 'selfhost');
+ const handleSignOut = async () => {
+ setIsSigningOut(true);
+ try {
+ await signOut();
+ } finally {
+ setIsSigningOut(false);
+ }
};
// Sync local UI status with real remote config
@@ -234,7 +237,6 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
setRemoteError(null);
clearRemoteServerSyncError();
setAuthProgress(null);
- setIsSuccessDismissed(false);
if (pendingLoginMethod === 'cloud') {
setCloudLoginStatus('success');
setSelfhostLoginStatus('idle');
@@ -303,15 +305,27 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
};
const renderSuccessContent = (method: LoginMethod) => {
+ const isStatusMode = mode === 'status';
+ const serverUrl = dataSyncConfig?.remoteServerUrl;
+
+ const title = isStatusMode
+ ? [method === 'cloud' ? t('screen5.status.cloud.title') : t('screen5.status.selfhost.title')]
+ : [t('screen5.title'), t('screen5.title2'), t('screen5.title3')];
+
+ const description = !isStatusMode
+ ? t('screen5.description')
+ : method === 'selfhost' && serverUrl
+ ? t('screen5.status.selfhost.description', { url: serverUrl })
+ : t('screen5.status.description');
+
return (
<Center gap={32} style={{ height: '100%', minHeight: '100%' }}>
<Flexbox align={'flex-start'} justify={'flex-start'} style={{ width: '100%' }}>
- <LobeMessage sentences={[t('screen5.title'), t('screen5.title2'), t('screen5.title3')]} />
- <Text as={'p'}>{t('screen5.description')}</Text>
+ <LobeMessage sentences={title} />
+ <Text as={'p'}>{description}</Text>
</Flexbox>
<Flexbox gap={16} style={{ width: '100%' }}>
- <Alert style={{ width: '100%' }} title={t('authResult.success.title')} type={'success'} />
<UserInfo
style={{
background: cssVar.colorFillSecondary,
@@ -321,16 +335,28 @@ const LoginStep = memo<LoginStepProps>(({ onBack, onNext }) => {
</Flexbox>
<Flexbox horizontal justify={'space-between'} style={{ marginTop: 32 }}>
- <Button
- icon={Undo2Icon}
- style={{ color: cssVar.colorTextDescription }}
- type={'text'}
- onClick={() => handleBackToLoginMethods(method)}
- >
- {t('back')}
- </Button>
+ {isStatusMode ? (
+ <Button
+ disabled={isSigningOut}
+ icon={LogOutIcon}
+ style={{ color: cssVar.colorTextDescription }}
+ type={'text'}
+ onClick={handleSignOut}
+ >
+ {isSigningOut ? t('screen5.actions.signingOut') : t('screen5.actions.signOut')}
+ </Button>
+ ) : (
+ <Button
+ icon={Undo2Icon}
+ style={{ color: cssVar.colorTextDescription }}
+ type={'text'}
+ onClick={onBack}
+ >
+ {t('back')}
+ </Button>
+ )}
<Button type={'primary'} onClick={onNext}>
- {t('next')}
+ {isStatusMode ? t('screen5.actions.done') : t('next')}
</Button>
</Flexbox>
</Center>