Skip to content

Commit 82fff92

Browse files
committed
auto-create storage
1 parent 144de96 commit 82fff92

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/Routes/Account.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Pdsinterop\PhpSolid\Session;
88
use Pdsinterop\PhpSolid\Mailer;
99
use Pdsinterop\PhpSolid\IpAttempts;
10+
use Pdsinterop\PhpSolid\StorageServer;
1011

1112
class Account {
1213
public static function requireLoggedInUser() {
@@ -87,11 +88,15 @@ public static function respondToAccountNew() {
8788
header("HTTP/1.1 400 Bad Request");
8889
exit();
8990
}
91+
$createdStorage = StorageServer::createStorage($createdUser['webId']);
92+
9093
Mailer::sendAccountCreated($createdUser);
9194

9295
$responseData = array(
93-
"webId" => $createdUser['webId']
96+
"webId" => $createdUser['webId'],
97+
"storageUrl" => $createdStorage['storageUrl']
9498
);
99+
95100
header("HTTP/1.1 201 Created");
96101
header("Content-type: application/json");
97102
Session::start($_POST['email']);

0 commit comments

Comments
 (0)