Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/desktop/src/renderer/settings/provider-connection-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,8 @@ function OAuthReloginNoticeForCurrentGeneration(props: {
hasSecret: CredentialPresenceStatus;
onRelogin(): Promise<void>;
}) {
const copy = getProviderSettingsCopy(useUiLocale()).detail;
const providerCopy = getProviderSettingsCopy(useUiLocale());
const copy = providerCopy.detail;
const flow = useOAuthLoginFlow({
bridge: props.service.bridge,
display: props.service.display,
Expand All @@ -1125,11 +1126,18 @@ function OAuthReloginNoticeForCurrentGeneration(props: {
: errored
? copy.oauthUnknownDetail
: copy.oauthStartDetail;
// Codex's device page has no code in its URL — the user must type the
// code shown here, so hiding it makes the re-login impossible to finish.
const deviceCode = props.service.showsDeviceCode ? flow.stateHint : null;
return (
<Banner
status="info"
title={title}
description={detail}
description={deviceCode ? (
<>
{detail} {providerCopy.oauthSection.deviceCode} <code>{deviceCode}</code>
</>
) : detail}
endContent={!loading ? (
<Button
variant="primary"
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop/src/renderer/settings/use-connection-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ import { runtimeHostOAuthLoginBridge } from './runtime-host-settings-bridge.js';
export interface OAuthLoginService {
bridge: OAuthLoginFlowBridge;
display: { name: string; shortName: string };
// Codex's device-authorization page requires the user to type the code the
// flow surfaces as `stateHint` — the verification URL does not embed it, so
// the notice must show it or the login cannot be completed. xAI's page
// needs no manual code, mirroring the catalog panel's `!isXai` guard.
showsDeviceCode: boolean;
}

export function oauthLoginServiceFor(
Expand All @@ -83,11 +88,13 @@ export function oauthLoginServiceFor(
return {
bridge: runtimeHostOAuthLoginBridge(window.maka.openAiCodex, host),
display: { name: 'OpenAI Codex', shortName: 'Codex' },
showsDeviceCode: true,
};
case 'xai-oauth':
return {
bridge: runtimeHostOAuthLoginBridge(window.maka.xaiOAuth, host),
display: { name: 'xAI Grok', shortName: 'SuperGrok / X Premium' },
showsDeviceCode: false,
};
default:
return null;
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading