Skip to content

Commit 374e2d6

Browse files
committed
let our own storage creation also get saved
1 parent 1378dfd commit 374e2d6

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

lib/Routes/Account.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public static function respondToAccountNew() {
8989
exit();
9090
}
9191
$createdStorage = StorageServer::createStorage($createdUser['webId']);
92+
User::setStorage($createdUser['userId'], $createdStorage['storageUrl']);
9293

9394
Mailer::sendAccountCreated($createdUser);
9495

lib/Routes/SolidStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function respondToStorage() {
4949

5050
// FIXME: Read allowed clients from the profile instead;
5151

52-
$ownerWebId = StorageServer::getOwnerWebId();
52+
$ownerWebId = StorageServer::getOwnerWebId();
5353
$owner = User::getUserByWebId($ownerWebId);
5454

5555
$allowedClients = $owner['allowedClients'] ?? [];

lib/Routes/SolidStorageProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@ public static function respondToStorageNew() {
2424
exit();
2525
}
2626

27-
//Mailer::sendStorageCreated($createdStoage);
28-
29-
$storageUrl = "https://storage-" . $createdStorage['storageId'] . "." . BASEDOMAIN . "/";
30-
3127
$responseData = array(
32-
"storage" => $storageUrl
28+
"storage" => $createdStorage['storageUrl']
3329
);
3430
header("HTTP/1.1 201 Created");
3531
header("Content-type: application/json");

lib/StorageServer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public static function createStorage($ownerWebId) {
4343
':owner' => $ownerWebId
4444
]);
4545
return [
46-
"storageId" => $generatedStorageId
46+
"storageId" => $generatedStorageId,
47+
"storageUrl" => "https://storage-" . $generatedStorageId . "." . BASEDOMAIN . "/"
4748
];
4849
}
4950

0 commit comments

Comments
 (0)