Skip to content

Commit 5d80061

Browse files
author
Vincent Molinié
committed
fix: rename frontend redirection route
1 parent 24373b3 commit 5d80061

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

packages/mcp-server/src/forest-oauth-provider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ describe('ForestAdminOAuthProvider', () => {
263263
);
264264

265265
expect(mockResponse.redirect).toHaveBeenCalledWith(
266-
expect.stringContaining('https://app.forestadmin.com/authentication/mcp-login'),
266+
expect.stringContaining('https://app.forestadmin.com/oauth/authorize'),
267267
);
268268
});
269269

@@ -284,7 +284,7 @@ describe('ForestAdminOAuthProvider', () => {
284284
const url = new URL(redirectCall);
285285

286286
expect(url.hostname).toBe('app.forestadmin.com');
287-
expect(url.pathname).toBe('/authentication/mcp-login');
287+
expect(url.pathname).toBe('/oauth/authorize');
288288
expect(url.searchParams.get('redirect_uri')).toBe('https://example.com/callback');
289289
expect(url.searchParams.get('code_challenge')).toBe('test-code-challenge');
290290
expect(url.searchParams.get('client_id')).toBe('test-client-id');

packages/mcp-server/src/forest-oauth-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default class ForestAdminOAuthProvider implements OAuthServerProvider {
8686
try {
8787
// Redirect to Forest Admin agent for actual authentication
8888
const agentAuthUrl = new URL(
89-
'/authentication/mcp-login',
89+
'/oauth/authorize',
9090
process.env.FOREST_FRONTEND_HOSTNAME || 'https://app.forestadmin.com',
9191
);
9292

packages/mcp-server/src/server.test.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ describe('ForestAdminMCPServer Instance', () => {
337337
});
338338

339339
expect(response.status).toBe(302);
340-
expect(response.headers.location).toContain(
341-
'https://app.forestadmin.com/authentication/mcp-login',
342-
);
340+
expect(response.headers.location).toContain('https://app.forestadmin.com/oauth/authorize');
343341

344342
const redirectUrl = new URL(response.headers.location);
345343
expect(redirectUrl.searchParams.get('redirect_uri')).toBe('https://example.com/callback');
@@ -362,9 +360,7 @@ describe('ForestAdminMCPServer Instance', () => {
362360
});
363361

364362
expect(response.status).toBe(302);
365-
expect(response.headers.location).toContain(
366-
'https://app.forestadmin.com/authentication/mcp-login',
367-
);
363+
expect(response.headers.location).toContain('https://app.forestadmin.com/oauth/authorize');
368364
});
369365

370366
it('should handle POST method for authorize', async () => {
@@ -382,7 +378,7 @@ describe('ForestAdminMCPServer Instance', () => {
382378

383379
expect(response.status).toBe(302);
384380
expect(response.headers.location).toStrictEqual(
385-
`https://app.forestadmin.com/authentication/mcp-login?redirect_uri=${encodeURIComponent(
381+
`https://app.forestadmin.com/oauth/authorize?redirect_uri=${encodeURIComponent(
386382
'https://example.com/callback',
387383
)}&code_challenge=test-challenge&client_id=registered-client&state=test-state&scope=${encodeURIComponent(
388384
'mcp:read',

0 commit comments

Comments
 (0)