1
This commit is contained in:
@@ -199,10 +199,11 @@ export default function WordPressIntegrationForm({
|
||||
}
|
||||
} else if (enabled && apiKey) {
|
||||
// Create integration when enabling for first time
|
||||
// Use API key-only authentication (no username/password required)
|
||||
await integrationApi.saveWordPressIntegration(siteId, {
|
||||
url: siteUrl || '',
|
||||
username: '',
|
||||
app_password: '',
|
||||
username: '', // Optional when using API key
|
||||
app_password: '', // Optional when using API key
|
||||
api_key: apiKey,
|
||||
is_active: enabled,
|
||||
sync_enabled: true,
|
||||
@@ -214,6 +215,10 @@ export default function WordPressIntegrationForm({
|
||||
if (onIntegrationUpdate && updated) {
|
||||
onIntegrationUpdate(updated);
|
||||
}
|
||||
} else if (enabled && !apiKey) {
|
||||
// Toggle enabled but no API key - show error
|
||||
toast.error('API key is required to enable WordPress integration');
|
||||
setIntegrationEnabled(false);
|
||||
}
|
||||
} catch (error: any) {
|
||||
toast.error(`Failed to update integration: ${error.message}`);
|
||||
|
||||
Reference in New Issue
Block a user