Skip credential defaulting for Appwrite -> Appwrite migrations

This commit is contained in:
Prem Palanisamy
2026-05-22 10:23:48 +01:00
parent f3955f92b2
commit e1ebdd1c4e
+4 -1
View File
@@ -488,7 +488,10 @@ class Migrations extends Action
try {
$credentials = $migration->getAttribute('credentials', []);
if ($migration->getAttribute('source') === SourceAppwrite::getName()) {
// Appwrite -> Appwrite requires explicit user-supplied source credentials;
// defaulting would silently self-call with the destination's own key.
if ($migration->getAttribute('source') === SourceAppwrite::getName()
&& $migration->getAttribute('destination') !== DestinationAppwrite::getName()) {
$credentials['projectId'] = $credentials['projectId'] ?? $project->getId();
$credentials['apiKey'] = $credentials['apiKey'] ?? $tempAPIKey;
$credentials['endpoint'] = $credentials['endpoint'] ?? $endpoint;