Skip to content

Commit

Permalink
dav: fixes in #255
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Dec 8, 2023
1 parent 22dd8a0 commit ac62355
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/OIDCLoginOption.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ public function getClass(): string
return 'oidc-button';
}

public function load(): void {}
public function load(): void
{
}
}
5 changes: 4 additions & 1 deletion lib/Provider/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ public function getProfile(): array
public function getTokenProfile(string $token): array
{
if ($this->isJWT($token)) {
return $this->decodeJWT($token, 1);
$jwt = $this->decodeJWT($token, 1);

// Convert stdClass to array recursively
return json_decode(json_encode($jwt), true);
}

$this->accessToken = $token;
Expand Down
3 changes: 2 additions & 1 deletion lib/WebDAV/BasicAuthBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public function validateUserPass($username, $password)
*/
public function handle(Event $event): void
{
if (!$event instanceof \OCA\DAV\Events\SabrePluginAuthInitEvent) {
if (!$event instanceof \OCA\DAV\Events\SabrePluginAuthInitEvent
&& !$event instanceof \OCP\SabrePluginEvent) {
return;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/WebDAV/BearerAuthBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public function validateBearerToken($bearerToken)
*/
public function handle(Event $event): void
{
if (!$event instanceof \OCA\DAV\Events\SabrePluginAuthInitEvent) {
if (!$event instanceof \OCA\DAV\Events\SabrePluginAuthInitEvent
&& !$event instanceof \OCP\SabrePluginEvent) {
return;
}

Expand Down

0 comments on commit ac62355

Please sign in to comment.