From c049444c10af972d9da6431e29b2dc9d4a6eadf8 Mon Sep 17 00:00:00 2001 From: Uladzimir Tsykun Date: Mon, 29 May 2023 01:05:17 +0200 Subject: [PATCH] Fix exception on view page when login via ldap --- src/Twig/PackagistExtension.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Twig/PackagistExtension.php b/src/Twig/PackagistExtension.php index 8ef8ade0..59031646 100644 --- a/src/Twig/PackagistExtension.php +++ b/src/Twig/PackagistExtension.php @@ -113,6 +113,9 @@ public function showApiTokenButton(UserInterface|string $token = null, bool $sho if ($token instanceof User) { $token = ($short ? ($token->getUserIdentifier() . ':') : '') . $token->getApiToken(); } + if ($token instanceof UserInterface) { + $token = ''; + } return $token ? '' : ''; }