Skip to content

Commit 7c3d589

Browse files
fix(agentic-cli): use configured dashboard auth endpoint
1 parent f88b784 commit 7c3d589

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

app/core/SDKConnectV2/adapters/host-application-adapter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ describe('HostApplicationAdapter', () => {
286286
});
287287

288288
describe('requestCliAuthToken', () => {
289-
it('opens the dashboard webview and resolves with its CLI token', async () => {
289+
it('opens the configured dashboard webview and resolves with its CLI token', async () => {
290290
(AgenticCliDashboardWebviewService.open as jest.Mock).mockResolvedValue(
291291
'cli-token',
292292
);
@@ -301,7 +301,7 @@ describe('HostApplicationAdapter', () => {
301301
).resolves.toBe('cli-token');
302302

303303
expect(AgenticCliDashboardWebviewService.open).toHaveBeenCalledWith({
304-
dashboardUrl: 'https://dashboard.w3a.io',
304+
dashboardUrl: 'https://test-dashboard.web3auth.io/agentic/auth',
305305
dashboardToken: 'mobile-auth-token',
306306
});
307307
});

app/core/SDKConnectV2/adapters/host-application-adapter.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { strings } from '../../../../locales/i18n';
1313
import { ConnectionInfo } from '../types/connection-info';
1414
import Engine from '../../Engine';
1515
import { Caip25EndowmentPermissionName } from '@metamask/chain-agnostic-permission';
16-
import logger from '../services/logger';
16+
import logger, { redactUrl } from '../services/logger';
1717
import { AgenticCliDashboardWebviewService } from '../../../components/Views/AgenticCliDashboardWebview/AgenticCliDashboardWebviewService';
1818

1919
const DASHBOARD_WEBVIEW_URLS = {
@@ -121,10 +121,17 @@ export class HostApplicationAdapter implements IHostApplicationAdapter {
121121
async requestCliAuthToken(
122122
_conninfo: ConnectionInfo,
123123
dashboardAccessToken: string,
124-
dashboardUrl: string = DEFAULT_DASHBOARD_WEBVIEW_URL,
124+
dashboardUrl?: string,
125125
): Promise<string> {
126+
if (dashboardUrl && dashboardUrl !== DEFAULT_DASHBOARD_WEBVIEW_URL) {
127+
logger.debug('Ignoring QR-provided Agentic CLI dashboard URL', {
128+
dashboardUrl: redactUrl(dashboardUrl),
129+
configuredDashboardUrl: DEFAULT_DASHBOARD_WEBVIEW_URL,
130+
});
131+
}
132+
126133
return AgenticCliDashboardWebviewService.open({
127-
dashboardUrl,
134+
dashboardUrl: DEFAULT_DASHBOARD_WEBVIEW_URL,
128135
dashboardToken: dashboardAccessToken,
129136
});
130137
}

0 commit comments

Comments
 (0)