Skip to content

Commit eaf9b59

Browse files
committed
Do not erase valid refresh tokens during SMTP Oauth connection
1 parent 68efe6a commit eaf9b59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/GLPIMailer.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public function smtpConnect($options = null)
138138
if (
139139
$this->oauth instanceof OAuthTokenProvider
140140
&& $result === true
141-
&& ($refresh_token = $this->oauth->getOauthToken()->getRefreshToken() ?? null) !== (new GLPIKey())->decrypt($CFG_GLPI['smtp_oauth_refresh_token'])
141+
&& ($refresh_token = $this->oauth->getOauthToken()->getRefreshToken() ?? null) !== null
142+
&& $refresh_token !== (new GLPIKey())->decrypt($CFG_GLPI['smtp_oauth_refresh_token'])
142143
) {
143144
// The refresh token may be refreshed itself.
144145
// Be sure to always store any new refresh token.

0 commit comments

Comments
 (0)