Revert "feat(makelore): add platform oidc login"

This reverts commit 7236def07d.
This commit is contained in:
brother7 committed 2026-10-11 12:04:01 +08:00
1 parent f2a0eefc9e
commit e28beff3a6
11 files changed
+10 -475

No files matched your search

-31
View File
@@ -21,16 +21,10 @@ const providerServiceMock = vi.hoisted(() => ({
deleteAccountApiKey: vi.fn(),
}));
const platformAuthMock = vi.hoisted(() => ({
startPlatformAuthorization: vi.fn(),
}));
vi.mock('@electron/services/providers/provider-service', () => ({
getProviderService: () => providerServiceMock,
}));
vi.mock('@electron/services/platform-auth', () => platformAuthMock);
function createResponse() {
const chunks: string[] = [];
const res = {
@@ -72,31 +66,6 @@ describe('auth host api routes', () => {
resetRememberedPasswordForTests();
providerServiceMock.deleteAccountApiKey.mockReset();
providerServiceMock.deleteAccountApiKey.mockResolvedValue(true);
platformAuthMock.startPlatformAuthorization.mockReset();
platformAuthMock.startPlatformAuthorization.mockResolvedValue({
requestId: 'request-1',
authorizationUrl: 'https://square.example.test/authorize?state=state-1',
});
});
it('starts platform OIDC in Main and returns only the browser authorization URL', async () => {
const response = createResponse();
const handled = await handleAuthRoutes(
createRequest('POST', {}),
response.res,
new URL('http://127.0.0.1:13210/api/auth/platform/start'),
{} as never,
);
expect(handled).toBe(true);
expect(response.statusCode).toBe(200);
expect(response.json()).toEqual({
success: true,
requestId: 'request-1',
authorizationUrl: 'https://square.example.test/authorize?state=state-1',
});
expect(platformAuthMock.startPlatformAuthorization).toHaveBeenCalledOnce();
});
it('projects a safe current-user identity and module access without exposing secrets', async () => {