48a4182ef9
The "Revoke Access" button in Astrolabe personal settings was failing with "Unable to connect to server" error in multi-user basic auth mode. Root cause: The JavaScript sends a POST request but the route was configured to accept DELETE. Changed the route to: - Use POST method (matching the JavaScript fetch call) - Use /api/v1/background-sync/credentials/revoke path (avoiding conflict with storeAppPassword which uses POST on the base URL) Added integration test that verifies the complete revoke flow: enable background sync → click revoke → verify credentials deleted. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
111 lines
2.2 KiB
PHP
111 lines
2.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Routes configuration for MCP Server UI app.
|
|
*
|
|
* Defines URL routes for OAuth flow and form handlers.
|
|
*/
|
|
|
|
return [
|
|
'routes' => [
|
|
// OAuth routes
|
|
[
|
|
'name' => 'oauth#initiateOAuth',
|
|
'url' => '/oauth/authorize',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'oauth#oauthCallback',
|
|
'url' => '/oauth/callback',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'oauth#disconnect',
|
|
'url' => '/oauth/disconnect',
|
|
'verb' => 'POST',
|
|
],
|
|
|
|
// API routes (form handlers)
|
|
[
|
|
'name' => 'api#revokeAccess',
|
|
'url' => '/api/revoke',
|
|
'verb' => 'POST',
|
|
],
|
|
|
|
// Background sync credentials routes
|
|
[
|
|
'name' => 'credentials#storeAppPassword',
|
|
'url' => '/api/v1/background-sync/credentials',
|
|
'verb' => 'POST',
|
|
],
|
|
[
|
|
'name' => 'credentials#getCredentials',
|
|
'url' => '/api/v1/background-sync/credentials/{userId}',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'credentials#deleteCredentials',
|
|
'url' => '/api/v1/background-sync/credentials/revoke',
|
|
'verb' => 'POST',
|
|
],
|
|
[
|
|
'name' => 'credentials#getStatus',
|
|
'url' => '/api/v1/background-sync/status',
|
|
'verb' => 'GET',
|
|
],
|
|
|
|
// Vector search API routes
|
|
[
|
|
'name' => 'api#search',
|
|
'url' => '/api/search',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'api#vectorStatus',
|
|
'url' => '/api/vector-status',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'api#chunkContext',
|
|
'url' => '/api/chunk-context',
|
|
'verb' => 'GET',
|
|
],
|
|
|
|
// Admin settings routes
|
|
[
|
|
'name' => 'api#serverStatus',
|
|
'url' => '/api/admin/server-status',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'api#adminVectorStatus',
|
|
'url' => '/api/admin/vector-status',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'api#saveSearchSettings',
|
|
'url' => '/api/admin/search-settings',
|
|
'verb' => 'POST',
|
|
],
|
|
|
|
// Webhook management routes (admin only)
|
|
[
|
|
'name' => 'api#getWebhookPresets',
|
|
'url' => '/api/admin/webhooks/presets',
|
|
'verb' => 'GET',
|
|
],
|
|
[
|
|
'name' => 'api#enableWebhookPreset',
|
|
'url' => '/api/admin/webhooks/presets/{presetId}/enable',
|
|
'verb' => 'POST',
|
|
],
|
|
[
|
|
'name' => 'api#disableWebhookPreset',
|
|
'url' => '/api/admin/webhooks/presets/{presetId}/disable',
|
|
'verb' => 'POST',
|
|
],
|
|
],
|
|
];
|