Skip to content

Commit 50bd346

Browse files
committed
get the owner and find out the allowed clients
1 parent 77c662a commit 50bd346

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/Routes/SolidStorage.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Pdsinterop\PhpSolid\Routes;
33

4+
use Pdsinterop\PhpSolid\User;
45
use Pdsinterop\PhpSolid\StorageServer;
56
use Pdsinterop\PhpSolid\ClientRegistration;
67
use Pdsinterop\PhpSolid\SolidNotifications;
@@ -40,9 +41,11 @@ public static function respondToStorage() {
4041
$origin = $rawRequest->getHeaderLine("Origin");
4142

4243
// FIXME: Read allowed clients from the profile instead;
43-
$owner = StorageServer::getOwner();
44-
44+
// $owner = StorageServer::getOwner();
45+
$ownerWebId = StorageServer::getOwnerWebId();
46+
$owner = User::getUserByWebId($ownerWebId);
4547
$allowedClients = $owner['allowedClients'] ?? [];
48+
4649
$allowedOrigins = TRUSTED_APPS ?? [];
4750
foreach ($allowedClients as $clientId) {
4851
$clientRegistration = ClientRegistration::getRegistration($clientId);

0 commit comments

Comments
 (0)