From 374e2d696ebef5a5c6af25ba24ac1d8f93be97ca Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Mon, 23 Mar 2026 14:00:33 +0100 Subject: [PATCH] let our own storage creation also get saved --- lib/Routes/Account.php | 1 + lib/Routes/SolidStorage.php | 2 +- lib/Routes/SolidStorageProvider.php | 6 +----- lib/StorageServer.php | 3 ++- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Routes/Account.php b/lib/Routes/Account.php index 1063902..55e08df 100644 --- a/lib/Routes/Account.php +++ b/lib/Routes/Account.php @@ -89,6 +89,7 @@ public static function respondToAccountNew() { exit(); } $createdStorage = StorageServer::createStorage($createdUser['webId']); + User::setStorage($createdUser['userId'], $createdStorage['storageUrl']); Mailer::sendAccountCreated($createdUser); diff --git a/lib/Routes/SolidStorage.php b/lib/Routes/SolidStorage.php index a811bf8..6eecb89 100644 --- a/lib/Routes/SolidStorage.php +++ b/lib/Routes/SolidStorage.php @@ -49,7 +49,7 @@ public static function respondToStorage() { // FIXME: Read allowed clients from the profile instead; - $ownerWebId = StorageServer::getOwnerWebId(); + $ownerWebId = StorageServer::getOwnerWebId(); $owner = User::getUserByWebId($ownerWebId); $allowedClients = $owner['allowedClients'] ?? []; diff --git a/lib/Routes/SolidStorageProvider.php b/lib/Routes/SolidStorageProvider.php index eb4b50c..6bc3a31 100644 --- a/lib/Routes/SolidStorageProvider.php +++ b/lib/Routes/SolidStorageProvider.php @@ -24,12 +24,8 @@ public static function respondToStorageNew() { exit(); } - //Mailer::sendStorageCreated($createdStoage); - - $storageUrl = "https://storage-" . $createdStorage['storageId'] . "." . BASEDOMAIN . "/"; - $responseData = array( - "storage" => $storageUrl + "storage" => $createdStorage['storageUrl'] ); header("HTTP/1.1 201 Created"); header("Content-type: application/json"); diff --git a/lib/StorageServer.php b/lib/StorageServer.php index 5584bc4..9e8c0f7 100644 --- a/lib/StorageServer.php +++ b/lib/StorageServer.php @@ -43,7 +43,8 @@ public static function createStorage($ownerWebId) { ':owner' => $ownerWebId ]); return [ - "storageId" => $generatedStorageId + "storageId" => $generatedStorageId, + "storageUrl" => "https://storage-" . $generatedStorageId . "." . BASEDOMAIN . "/" ]; }