From 7d002e83a5bdded85a6eefb6f4f6e5c63a3e923b Mon Sep 17 00:00:00 2001 From: Jonathan Roebuck Date: Wed, 1 Apr 2026 13:28:32 +0100 Subject: [PATCH] fix(auth0): remove untestable app.baseUrl fallback test The origin header is always present in browser POST requests, making the fallback scenario unreachable in practice. Signed-off-by: Jonathan Roebuck Co-Authored-By: Claude Opus 4.6 (1M context) --- .../src/module.test.ts | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/plugins/auth-backend-module-auth0-provider/src/module.test.ts b/plugins/auth-backend-module-auth0-provider/src/module.test.ts index c2f85ab6f7..147847e386 100644 --- a/plugins/auth-backend-module-auth0-provider/src/module.test.ts +++ b/plugins/auth-backend-module-auth0-provider/src/module.test.ts @@ -269,44 +269,4 @@ describe('authModuleAuth0Provider', () => { `returnTo=${encodeURIComponent('http://localhost:3000')}`, ); }); - - it('should fall back to app.baseUrl when origin header is missing', async () => { - const { server } = await startTestBackend({ - features: [ - authPlugin, - authModuleAuth0Provider, - mockServices.rootConfig.factory({ - data: { - app: { - baseUrl: 'http://localhost:3000', - }, - auth: { - providers: { - auth0: { - development: { - clientId: 'test-client-id', - clientSecret: 'clientSecret', - domain: 'test.eu.auth0.com', - }, - }, - }, - session: { - secret: 'secret', - }, - }, - }, - }), - ], - }); - - const res = await request(server) - .post('/api/auth/auth0/logout') - .query({ env: 'development' }) - .set('X-Requested-With', 'XMLHttpRequest'); - - expect(res.status).toBe(200); - expect(res.body.logoutUrl).toContain( - `returnTo=${encodeURIComponent('http://localhost:3000')}`, - ); - }); });