From 4dd967df9235128ca69335525547043b276f36b8 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 28 Mar 2024 13:36:57 +0530 Subject: [PATCH 1/2] fix sso autologin --- lib/Listeners/BeforeTemplateRenderedListener.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index adece9c3..6a67c743 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -67,7 +67,9 @@ class BeforeTemplateRenderedListener implements IEventListener { // Just send over '1' as password to trigger login as the plugin will set the correct access token $password = self::SNAPPYMAIL_AUTOLOGIN_PWD; // As we cannot pass by reference to LoginProcess - $account = $actions->LoginProcess($accountId, $password, false); + $oPasswordSensitive = new SnappyMail\SensitiveString($password); + + $account = $actions->LoginProcess($accountId, $oPasswordSensitive, false); if ($account) { $actions->Plugins()->RunHook('login.success', array($account)); $actions->SetAuthToken($account); -- GitLab From d104a9130a19e8426e8243a863c7bebf7aca9bc6 Mon Sep 17 00:00:00 2001 From: Avinash Gusain Date: Thu, 28 Mar 2024 13:47:48 +0530 Subject: [PATCH 2/2] fix sso autologin --- lib/Listeners/BeforeTemplateRenderedListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Listeners/BeforeTemplateRenderedListener.php b/lib/Listeners/BeforeTemplateRenderedListener.php index 6a67c743..c256529f 100644 --- a/lib/Listeners/BeforeTemplateRenderedListener.php +++ b/lib/Listeners/BeforeTemplateRenderedListener.php @@ -67,7 +67,7 @@ class BeforeTemplateRenderedListener implements IEventListener { // Just send over '1' as password to trigger login as the plugin will set the correct access token $password = self::SNAPPYMAIL_AUTOLOGIN_PWD; // As we cannot pass by reference to LoginProcess - $oPasswordSensitive = new SnappyMail\SensitiveString($password); + $oPasswordSensitive = new \SnappyMail\SensitiveString($password); $account = $actions->LoginProcess($accountId, $oPasswordSensitive, false); if ($account) { -- GitLab