File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22namespace OCA \Solid \Controller ;
33
44use OCA \Solid \DpopFactoryTrait ;
5+ use OCA \Solid \BearerFactoryTrait ;
56use OCA \Solid \PlainResponse ;
67use OCA \Solid \Notifications \SolidNotifications ;
78
@@ -304,13 +305,28 @@ public function handleRequest($userId, $path) {
304305
305306 $ dpop = $ this ->getDpop ();
306307
308+ $ error = false ;
307309 try {
308310 $ webId = $ dpop ->getWebId ($ request );
309311 } catch (\Pdsinterop \Solid \Auth \Exception \Exception $ e ) {
312+ $ error = $ e ;
313+ }
314+
315+ if (!isset ($ webId )) {
316+ $ bearer = $ this ->getBearer ();
317+ try {
318+ $ webId = $ bearer ->getWebId ($ request );
319+ } catch (\Pdsinterop \Solid \Auth \Exception \Exception $ e ) {
320+ $ error = $ e ;
321+ }
322+ }
323+
324+ if (!isset ($ webId )) {
310325 $ response = $ this ->resourceServer ->getResponse ()
311- ->withStatus (Http::STATUS_CONFLICT , "Invalid token " . $ e -> getMessage () );
326+ ->withStatus (Http::STATUS_CONFLICT , "Invalid token " );
312327 return $ this ->respond ($ response );
313328 }
329+
314330 $ origin = $ request ->getHeaderLine ("Origin " );
315331 $ allowedClients = $ this ->config ->getAllowedClients ($ userId );
316332 $ allowedOrigins = array ();
You can’t perform that action at this time.
0 commit comments